Skip to content

aminnzo/animated_loading_button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

animated_loading_button

Pub build

AnimatedLoadingButton is a Flutter package with loading, success and error animations.

Installation

Add this to your pubspec.yaml:

    dependencies:
        animated_loading_button: ^0.0.1

Usage

Import

    import 'package:animated_loading_button/animated_loading_button.dart';

Simple Implementation

    final LoadingButtonController _controller = new LoadingButtonController();

    void _doSomething() async {
        Timer(Duration(seconds: 2), () {
            _controller.success();
        });
    }

    LoadingButton(
        child: Text('Tap me!', style: TextStyle(color: Colors.white)),
        controller: _controller,
        onPressed: _doSomething,
    )

Customization

Here is a list of properties available to customize your widget:

Name Type Description
onPressed VoidCallback callback invoked when the button is tapped
child Widget the button's label
color Color primary color of the button
height double vertical extent of the button
width double horizontal extent of the button
iconSize double size of success and error icons
loaderStrokeWidth double stroke width of the animated loading circle
valueColor Color color of the static icons
borderRadius double radius of the button border
elevation double elevation of the raised button
errorColor Color color of the button when it is in the error state
successColor Color color of the button when it is in the success state
disabledColor Color color of the button when it is disabled

Contributions

Contributions of any kind are more than welcome! Feel free to fork and improve animated_loading_button in any way you want, make a pull request, or open an issue.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages