future_button
Customizable Material and Cupertino buttons with progress indicators and more.
Useful if you want to run some background tasks when user presses on the button, and then show the result of the task.
How to use it
Usage is extremely simple - right now 5 types of buttons are supported:
CupertinoButton
(normal + filled)FlatButton
(normal + icon)IconButton
OutlineButton
(normal + icon)RaisedButton
(normal + icon)
To convert a button to a FutureButton
, just add a Future
prefix and make sure that your onPressed
callback is of type Future<void> Function()
, instead of usual void Function()
.
Everything that the package does can be customized. Below is the list of all parameters:
Example
See example
project for more details.
Getting Started
Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
future_button: ^0.1.1
Install it
You can install packages from the command line:
Import it
Now in your Dart code, you can use: