load_future

Last updated:

0 purchases

load_future Image
load_future Images
Add to Cart

Description:

load future

Load Future with dialog progress bar
Preview #

Features #

Load Future
Customize loader
Without context
return Future

Getting started #
Add dependency #
load_future: ^0.1.0
copied to clipboard
Wrap App or any Widget with LoadBuilder #
Wrap MaterialApp or any Widget with LoadBuilder where you want to show loading.
LoadBuilder(
builder: (context, child, isLoading) => DialogBarrier(
isLoading: isLoading,
indicator: const CircularProgressIndicator(),
child: child,
),
child: const MaterialApp(
title: title,
home: MyHomePage(title: title),
),
);
copied to clipboard
Usage #
Wrap your Future<T> with Future<T> context.load(Future<T> future) #
Future<Response> longTask() async {
...;
}

onTap: () => context.load(longTask())
.then((response) => ...) // work with success result
.catchError((e, s) => ...) // work with error
copied to clipboard
Warning #
load can be called only with BuildContext.
Dialog is not dismissible. You should cancel wrapped Future by own. Example:
load(future.timeout(duration))

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.