animated_progress_button 1.0.0 copy "animated_progress_button: ^1.0.0" to clipboard
animated_progress_button: ^1.0.0 copied to clipboard

outdated

A new Flutter package.

Animated Progress Button #

Silas

Animated loading button to make you app button looks smoother. Take inspritation from Pinterest https://www.pinterest.com/pin/671177150707141229/

alt text

Usages #

Create animatedButtonController for controlling the button.

import 'package:...';

final AnimatedButtonController animatedButtonController = AnimatedButtonController();

Then customize the button like your own way Noted that you must call animatedButtonController.completed() after getting response from server in order to complete the button animation

AnimatedButton(
   controller: animatedButtonController,
   color: Colors.greenAccent,
   text: 'Log in',
   loadingText: 'Loading',
   loadedIcon: Icon(Icons.check, color: Colors.white),
   onPressed: () async {
       /// calling your API here and wait for the response.
       await Future.delayed(Duration(seconds: 5)); // simulated your API requesting time.
       animatedButtonController.completed(); // call when you get the response
       await Future.delayed(Duration(seconds: 2));
       animatedButtonController.reset(); // call to reset button animation
   },
),
27
likes
0
pub points
32%
popularity

Publisher

unverified uploader

A new Flutter package.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on animated_progress_button