AsyncButton<T> constructor

const AsyncButton<T>({
  1. Key? key,
  2. required Future<T> future(),
  3. required String beforeLabel,
  4. required String afterLabel,
  5. void onSuccess(
    1. T result
    )?,
  6. void onError(
    1. dynamic error
    )?,
  7. bool hapticeFeedback = true,
  8. Color color = Colors.blue,
  9. Color labelColor = Colors.white,
  10. Duration animationDuration = const Duration(milliseconds: 300),
  11. 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,
});