showFlash<T> method

Future<T?> showFlash<T>({
  1. Duration transitionDuration = const Duration(milliseconds: 250),
  2. Duration reverseTransitionDuration = const Duration(milliseconds: 200),
  3. Color? barrierColor,
  4. double? barrierBlur,
  5. bool barrierDismissible = false,
  6. FutureOr<bool> onBarrierTap()?,
  7. Curve barrierCurve = Curves.ease,
  8. bool persistent = true,
  9. VoidCallback? onRemoveFromRoute,
  10. Duration? duration,
  11. required FlashBuilder<T> builder,
  12. Completer<T>? dismissCompleter,
})

Implementation

Future<T?> showFlash<T>({
  Duration transitionDuration = const Duration(milliseconds: 250),
  Duration reverseTransitionDuration = const Duration(milliseconds: 200),
  Color? barrierColor,
  double? barrierBlur,
  bool barrierDismissible = false,
  FutureOr<bool> Function()? onBarrierTap,
  Curve barrierCurve = Curves.ease,
  bool persistent = true,
  VoidCallback? onRemoveFromRoute,
  Duration? duration,
  required FlashBuilder<T> builder,
  Completer<T>? dismissCompleter,
}) {
  final controller = DefaultFlashController<T>(
    this,
    transitionDuration: transitionDuration,
    reverseTransitionDuration: reverseTransitionDuration,
    barrierColor: barrierColor,
    barrierBlur: barrierBlur,
    barrierDismissible: barrierDismissible,
    onBarrierTap: onBarrierTap,
    barrierCurve: barrierCurve,
    persistent: persistent,
    onRemoveFromRoute: onRemoveFromRoute,
    duration: duration,
    builder: builder,
  );
  dismissCompleter?.future.then(controller.dismiss);
  return controller.show();
}