FutureDebounceButton<T> constructor
const
FutureDebounceButton<T> ({
- Key? key,
- bool enabled = true,
- required Future<
T> onPressed(), - void onSuccess(
- T value
- dynamic onError(
- dynamic error,
- dynamic stackTrace
- dynamic onAbort()?,
- void onStateChange()?,
- FDBType buttonType = FDBType.filled,
- String? actionCallText = 'Go',
- Widget? actionCallChild,
- ButtonStyle? actionCallButtonStyle,
- String? loadingText,
- Widget? loadingChild,
- ButtonStyle? loadingButtonStyle,
- String? abortText = 'Abort',
- String? abortPressedText = 'Cancelled',
- Widget? abortChild,
- Widget? abortPressedChild,
- ButtonStyle? abortButtonStyle,
- Duration? abortStateDuration = const Duration(seconds: 1),
- String? errorText = 'Error',
- Widget? errorChild,
- ButtonStyle? errorButtonStyle,
- Duration? errorStateDuration = const Duration(seconds: 1),
- String? successText = 'Success!',
- Widget? successChild,
- ButtonStyle? successButtonStyle,
- Duration? successStateDuration = const Duration(seconds: 1),
- Duration debounceDuration = const Duration(milliseconds: 250),
- Duration? timeout,
Implementation
const FutureDebounceButton({
Key? key,
this.enabled = true,
required this.onPressed,
this.onSuccess,
this.onError,
this.onAbort,
this.onStateChange,
this.buttonType = FDBType.filled,
this.actionCallText = 'Go',
this.actionCallChild,
this.actionCallButtonStyle,
this.loadingText,
this.loadingChild,
this.loadingButtonStyle,
this.abortText = 'Abort',
this.abortPressedText = 'Cancelled',
this.abortChild,
this.abortPressedChild,
this.abortButtonStyle,
this.abortStateDuration = const Duration(seconds: 1),
this.errorText = 'Error',
this.errorChild,
this.errorButtonStyle,
this.errorStateDuration = const Duration(seconds: 1),
this.successText = 'Success!',
this.successChild,
this.successButtonStyle,
this.successStateDuration = const Duration(seconds: 1),
this.debounceDuration = const Duration(milliseconds: 250),
this.timeout,
}) : assert(onPressed is! Future),
super(key: key);