show static method

void show({
  1. required Widget title,
  2. BuildContext? context,
  3. OverlayState? overlayState,
  4. AlignmentGeometry? alignment,
  5. Duration? autoCloseDuration,
  6. Duration? animationDuration,
  7. ToastificationAnimationBuilder? animationBuilder,
  8. ToastificationType? type,
  9. ToastificationStyle? style,
  10. Widget? description,
  11. Widget? icon,
  12. Color? primaryColor,
  13. Color? backgroundColor,
  14. Color? foregroundColor,
  15. EdgeInsetsGeometry? padding,
  16. EdgeInsetsGeometry? margin,
  17. BorderRadiusGeometry? borderRadius,
  18. BorderSide? borderSide,
  19. List<BoxShadow>? boxShadow,
  20. TextDirection? direction,
  21. bool? showProgressBar,
  22. ProgressIndicatorThemeData? progressBarTheme,
  23. ToastCloseButton? closeButton,
  24. bool? closeOnClick,
  25. bool? dragToClose,
  26. bool? showIcon,
  27. DismissDirection? dismissDirection,
  28. bool? pauseOnHover,
  29. bool? applyBlurEffect,
  30. ToastificationCallbacks callbacks = const ToastificationCallbacks(),
  31. bool? blockBackgroundInteraction,
})

显示

Implementation

static void show({
  required Widget title,
  BuildContext? context,
  OverlayState? overlayState,
  AlignmentGeometry? alignment,
  Duration? autoCloseDuration,
  Duration? animationDuration,
  ToastificationAnimationBuilder? animationBuilder,
  ToastificationType? type,
  ToastificationStyle? style,
  Widget? description,
  Widget? icon,
  Color? primaryColor,
  Color? backgroundColor,
  Color? foregroundColor,
  EdgeInsetsGeometry? padding,
  EdgeInsetsGeometry? margin,
  BorderRadiusGeometry? borderRadius,
  BorderSide? borderSide,
  List<BoxShadow>? boxShadow,
  TextDirection? direction,
  bool? showProgressBar,
  ProgressIndicatorThemeData? progressBarTheme,
  ToastCloseButton? closeButton,
  bool? closeOnClick,
  bool? dragToClose,
  bool? showIcon,
  DismissDirection? dismissDirection,
  bool? pauseOnHover,
  bool? applyBlurEffect,
  ToastificationCallbacks callbacks = const ToastificationCallbacks(),
  bool? blockBackgroundInteraction,
}) {
  toastification.show(
    context: context,
    overlayState: overlayState,
    alignment: alignment ?? Alignment.bottomCenter,
    autoCloseDuration: autoCloseDuration ?? const Duration(seconds: 3),
    animationDuration: animationDuration,
    type: type,
    style: style ?? ToastificationStyle.flatColored,
    title: title,
    description: description,
    icon: icon,
    primaryColor: primaryColor,
    backgroundColor: backgroundColor,
    foregroundColor: foregroundColor,
    padding: padding,
    margin: margin,
    borderRadius: borderRadius ?? BorderRadius.circular(AppTheme.radius),
    borderSide: borderSide,
    boxShadow: boxShadow,
    direction: direction,
    showProgressBar: showProgressBar,
    progressBarTheme: progressBarTheme,
    closeButton:
        closeButton ??
        ToastCloseButton(
          buttonBuilder: (context, onClose) => Material(
            color: Colors.transparent,
            child: InkWell(onTap: onClose, child: Icon(CupertinoIcons.clear, size: 20)),
          ),
        ),
    closeOnClick: closeOnClick,
    dragToClose: dragToClose ?? true,
    showIcon: showIcon,
    dismissDirection: dismissDirection,
    pauseOnHover: pauseOnHover ?? true,
    applyBlurEffect: applyBlurEffect,
    callbacks: callbacks,
    // blockBackgroundInteraction: blockBackgroundInteraction,
  );
}