load_future 0.0.3 copy "load_future: ^0.0.3" to clipboard
load_future: ^0.0.3 copied to clipboard

Load future with proggress dialog.

Load Future with dialog progress bar

Preview #

The preview app running in macOS

Features #

  • Load Future
  • Customize loader
  • Without context
  • return Future

Getting started #

Add dependency #

load_future: ^latest

Wrap XApp with LoadWidget #

Wrap MaterialApp or CupertinoApp with LoadWidget and use common navigatorKey.

final navigatorKey = GlobalKey<NavigatorState>();

LoadWidget(
  navigatorKey: navigatorKey,
  ...
  child: MaterialApp(
    navigatorKey: navigatorKey,
    ...
    ),
);

Usage #

Wrap your Future<T> with Future<T> load(Future<T> future) #

Future<Response> longTask() async {
  ...;
}

onTap: () => load(longTask())
            .then((response) => ...) // work with success result
            .catchError((e, s) => ...) // work with error

Warning #

Dialog is not dismissible. You should cancel wrapped Future by own. Example: load(future.timeout(duration))

Feature plans: #

  • ❌ Load Stream Builder from Future
1
likes
140
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

Load future with proggress dialog.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

async, flutter

More

Packages that depend on load_future