AsyncButton<T> constructor
const
AsyncButton<T> ({
- Key? key,
- required Future<
T> future(), - required String beforeLabel,
- required String afterLabel,
- void onSuccess(
- T result
- void onError(
- dynamic error
- bool hapticeFeedback = true,
- Color color = Colors.blue,
- Color labelColor = Colors.white,
- Duration animationDuration = const Duration(milliseconds: 300),
- bool? initialState = false,
Implementation
const AsyncButton({
super.key,
required this.future,
required this.beforeLabel,
required this.afterLabel,
this.onSuccess,
this.onError,
this.hapticeFeedback = true,
this.color = Colors.blue,
this.labelColor = Colors.white,
this.animationDuration = const Duration(milliseconds: 300),
this.initialState = false,
});