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

outdated

Buttons with progress bars

future_button #

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

40
likes
0
pub points
58%
popularity

Publisher

unverified uploader

Buttons with progress bars

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on future_button