progress_builder 1.0.1 copy "progress_builder: ^1.0.1" to clipboard
progress_builder: ^1.0.1 copied to clipboard

outdated

A simple wrapper for asynchronous actions with progress/loading indicators and error handling.

Progress Builder #

A simple wrapper for asynchronous actions with progress/loading indications and error handling.

Usage #

The following will:

  • await the Future.delayed()
  • show LinearProgressIndicator while it is being awaited
  • print 'success' if successful
  • print error: ...exception... in case of an exception
  • print 'done' in all cases
import 'package:progress_builder/progress_builder.dart';

...
                LinearProgressBuilder(
                  builder: (action, _) => ElevatedButton(
                    onPressed: action,
                    child: Text('PRESS ME'),
                  ),
                  action: () async {
                    print('loading');
                    await Future.delayed(const Duration(seconds: 2));
                    print('loaded');
                  },
                  onDone: () => print('done'),
                  onError: (error) => print('error $error'),
                  onSuccess: () => print('success'),
                ),

TODO #

[] Add documentation on how to use the actual progress value callback

Features and bugs #

Please file feature requests and bugs at the issue tracker.

5
likes
0
points
80
downloads

Publisher

verified publisherapexive.com

Weekly Downloads

A simple wrapper for asynchronous actions with progress/loading indicators and error handling.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on progress_builder