AsyncToggleWidget<T> constructor

const AsyncToggleWidget<T>({
  1. Key? key,
  2. required Future<T> future(),
  3. required Widget before,
  4. required Widget after,
  5. bool? initialState = false,
  6. void onSuccess(
    1. T result
    )?,
  7. void onError(
    1. dynamic error
    )?,
  8. Duration animationDuration = const Duration(milliseconds: 300),
})

Implementation

const AsyncToggleWidget({
  super.key,
  required this.future,
  required this.before,
  required this.after,
  this.initialState = false,
  this.onSuccess,
  this.onError,
  this.animationDuration = const Duration(milliseconds: 300),
});