loading_icon_button 0.0.1
loading_icon_button: ^0.0.1 copied to clipboard
Loading icon button implementation of loading button
loading icon button #
with Card | without Card |
---|---|
[] | [] |
Installation #
Add this to your pubspec.yaml:
dependencies:
loading_icon_button: ^0.0.1
Usage #
Import #
import 'package:loading_icon_button/loading_icon_button.dart';
Simple Implementation #
final LoadingButtonController _btnController = LoadingButtonController();
void buttonPressed() async {
Future.delayed(const Duration(seconds: 1), () {
_btnController.error();
Future.delayed(const Duration(seconds: 1), () {
_btnController.reset();
});
});
}
LoadingButton(
color: const Color(0xff0066ff),
iconColor: Colors.white,
valueColor: const Color(0xff0066ff),
errorColor: const Color(0xffe0333c),
successColor: const Color(0xff58B09C),
child: Text(
'Login with Google',
style: GoogleFonts.openSans().copyWith(
fontWeight: FontWeight.w500,
color: Colors.white,
),
),
iconData: PhosphorIcons.googleLogo,
onPressed: () {
buttonPressed();
},
successIcon: PhosphorIcons.check,
controller: _btnController,
),
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!
Thanks to #
RoundedLoadingButton rounded_loading_button
https://pub.dev/packages/rounded_loading_button
IconLoadingButton icon_loading_button
https://pub.dev/packages/icon_loading_button