loading_icon_button 0.0.7 loading_icon_button: ^0.0.7 copied to clipboard
Loading button with icon and text in Flutter. It's working on all flutter platforms. It's a simple way to show a loading button.
loading icon button #
LoadingButton | LoadingButton | ArgonButton |
Installation #
Add this to your pubspec.yaml:
dependencies:
loading_icon_button: ^0.0.5
Usage #
Import #
import 'package:loading_icon_button/loading_icon_button.dart';
Implementation of LoadingButton #
final LoadingButtonController _btnController = LoadingButtonController();
void buttonPressed() async {
Future.delayed(const Duration(seconds: 1), () {
_btnController.success();
Future.delayed(const Duration(seconds: 1), () {
_btnController.reset();
});
});
}
LoadingButton(
child: const Text('Login with Apple'),
iconData: PhosphorIcons.appleLogo,
onPressed: () => buttonPressed(),
controller: _btnController,
);
Implementation of ArgonButton #
ArgonButton(
height: 50,
width: 350,
borderRadius: 5.0,
color: Color(0xFF7866FE),
child: Text(
"Continue",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w700
),
),
loader: Container(
padding: EdgeInsets.all(10),
child: SpinKitRotatingCircle(
color: Colors.white,
// size: loaderWidth ,
),
),
onTap: (startLoading, stopLoading, btnState) {
},
),
ArgonButton(
[...]
onTap:(startLoading, stopLoading, btnState){
if(btnState == ButtonState.Idle){
startLoading();
await doNetworkRequest();
stopLoading();
}
}
),
Properties of IconLoadingButton:
duration
- The duration of the button animationloaderSize
- The size of the CircularProgressIndicatoranimateOnTap
- Whether to trigger the loading animation on the tap eventresetAfterDuration
- Reset the animation after specified duration, defaults to 15 secondserrorColor
- The color of the button when it is in the error statesuccessColor
- The color of the button when it is in the success statesuccessIcon
- The icon for the success statefailedIcon
- The icon for the failed stateiconColor
- The icon color for the buttonshowBox
- The visibility of the box(Card)
Contributions #
All contributions are welcome! Contributions are what make the open source community such an amazing place to be learned, inspire, and create. Any contributions you make are greatly appreciated.
Thanks to #
RoundedLoadingButton rounded_loading_button
https://pub.dev/packages/rounded_loading_button
IconLoadingButton icon_loading_button
https://pub.dev/packages/icon_loading_button
ArgonButton argon_buttons_flutter
https://pub.dev/packages/argon_buttons_flutter