Last updated:
0 purchases
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))
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.