0 purchases
awaitable button
Awaitable Button #
Features #
Button with indicator display during processing to prevent consecutive hits.
Web demo for awaitable_button/example #
You can try out the interactive buttons on the demo page below.
https://altive.github.io/flutter_widgets/
Getting started #
awaitable_button: any
copied to clipboard
Usage #
import 'package:awaitable_button/awaitable_button.dart';
copied to clipboard
This package includes the following buttons.
Use them according to your style.
AwaitableElevatedButton
AwaitableOutlinedButton
AwaitableTextButton
AwaitableFilledButton
AwaitableFilledTonalButton
@override
Widget build(BuildContext context) {
return AwaitableElevatedButton<String>(
// Required
onPressed: () {
// do something
},
// Optional
whenComplete: (value) {
// do something
},
// Optional
onError: (exception, stackTrace) {
// do something
},
// Optional
buttonStyle: ElevatedButton.styleFrom(),
// Optional
indicator: CircularProgressIndicator(),
// Optional
indicatorColor: Colors.green,
// Optional
indicatorSize: Size.square(24),
// Optional
executingChild: const Text('Executing...'),
// Required
child: const Text('Button'),
);
}
copied to clipboard
AwaitableOutlinedButton, AwaitableTextButton, AwaitableFilledButton and AwaitableFilledTonalButton is exactly the same as for AwaitableElevatedButton.
@override
Widget build(BuildContext context) {
return AwaitableIconButton<String>(
// Required
onPressed: () {
// do something
},
// Optional
whenComplete: (value) {
// do something
},
// Optional
onError: (exception, stackTrace) {
// do something
},
// Optional
iconSize: 24,
// Optional
indicator: CircularProgressIndicator(),
// Optional
indicatorColor: Colors.green,
// Optional
indicatorSize: Size.square(24),
// Optional
executingIcon: const Icon(Icons.timer_sharp),
// Required
icon: const Icon(Icons.timer),
);
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.