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

Gradient loading button with success and error result

Loading Button #

A simple button that gives you the possibility to transform into a circular one and shows a progress indicator and with success and error state.

How to use #

Container(
  width: 200,
  height: 60,
  child: LoadingButton(
    borderRadius: BorderRadius.all(Radius.circular(8)),
    gradient: new LinearGradient(
      colors: <Color>[
        Colors.red,
        Colors.blue,
      ]
    ),
    strokeWidth: 2,
    child: Text(
      "Sample",
      style: TextStyle(
        color: Colors.white,
        fontSize: 24,
      ),
    ),
    errorChild: const Icon( Icons.close_sharp, color: Colors.white, ),
    successChild: const Icon( Icons.check_sharp, color: Colors.white, ),
    onPressed: ( controller ) async {
      await controller.loading();
      await new Future.delayed( const Duration( seconds: 3 ) );
      if ( Random.secure().nextBool() )
        await controller.success();
      else await controller.error();
    },
  ),
),

Please check the example folder for a simple implementation.

Changelog #

Please see the Changelog page to know what's recently changed.

Contributions #

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue. If you fixed a bug or implemented a new feature, please send a pull request.

License #

This project is licensed under the MIT License - see the LICENSE.md file for details

4
likes
30
pub points
39%
popularity

Publisher

unverified uploader

Gradient loading button with success and error result

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on gradient_loading_button