future_button 0.0.2 copy "future_button: ^0.0.2" to clipboard
future_button: ^0.0.2 copied to clipboard

outdated

Customizable Material and Cupertino buttons with progress bars. Useful if you want to show a loading indicator when user presses some action.

future_button #

Build status Pub version

Customizable Material and Cupertino buttons with progress indicators.

Useful if you want to run some background tasks when user presses on the button.

Demonstration

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().

Example #

FutureRaisedButton.icon(
  icon: Icon(Icons.star),
  label: Text('Star'),
  onPressed: () async {
    // Do some background task
    await Future.delayed(Duration(seconds: 5));
  },
);

See example project for more details.

Getting Started #

Depend on it #

Add this to your package's pubspec.yaml file:

dependencies:
  future_button: ^0.0.1

Install it #

You can install packages from the command line:

$ flutter pub get

Import it #

Now in your Dart code, you can use:

import 'package:equinox/equinox.dart';

Contact me #

E-mail: kk.erzhan@gmail.com

39
likes
0
pub points
70%
popularity

Publisher

unverified uploader

Customizable Material and Cupertino buttons with progress bars. Useful if you want to show a loading indicator when user presses some action.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on future_button