FutureDebounceButton<T> constructor

const FutureDebounceButton<T>({
  1. Key? key,
  2. bool enabled = true,
  3. required Future<T> onPressed(),
  4. void onSuccess(
    1. T value
    )?,
  5. dynamic onError(
    1. dynamic error,
    2. dynamic stackTrace
    )?,
  6. dynamic onAbort()?,
  7. void onStateChange(
    1. FDBState
    )?,
  8. FDBType buttonType = FDBType.filled,
  9. String? actionCallText = 'Go',
  10. Widget? actionCallChild,
  11. ButtonStyle? actionCallButtonStyle,
  12. String? loadingText,
  13. Widget? loadingChild,
  14. ButtonStyle? loadingButtonStyle,
  15. String? abortText = 'Abort',
  16. String? abortPressedText = 'Cancelled',
  17. Widget? abortChild,
  18. Widget? abortPressedChild,
  19. ButtonStyle? abortButtonStyle,
  20. Duration? abortStateDuration = const Duration(seconds: 1),
  21. String? errorText = 'Error',
  22. Widget? errorChild,
  23. ButtonStyle? errorButtonStyle,
  24. Duration? errorStateDuration = const Duration(seconds: 1),
  25. String? successText = 'Success!',
  26. Widget? successChild,
  27. ButtonStyle? successButtonStyle,
  28. Duration? successStateDuration = const Duration(seconds: 1),
  29. Duration debounceDuration = const Duration(milliseconds: 250),
  30. 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);