showNotification static method

void showNotification({
  1. ToastBuilder? leading,
  2. ToastBuilder? title,
  3. ToastBuilder? subtitle,
  4. ToastBuilder? trailing,
  5. WrapAnimation? wrapAnimation,
  6. WrapAnimation? wrapToastAnimation,
  7. GestureTapCallback? onTap,
  8. Color? backgroundColor,
  9. double? borderRadius,
  10. GestureLongPressCallback? onLongPress,
  11. Alignment? align,
  12. BackButtonBehavior? backButtonBehavior,
  13. Duration? duration,
  14. Duration? animationDuration,
  15. Duration? animationReverseDuration,
  16. EdgeInsetsGeometry? contentPadding,
  17. EdgeInsetsGeometry? margin,
  18. VoidCallback? onClose,
  19. bool crossPage = true,
  20. bool onlyOne = true,
  21. bool enableSlideOff = true,
})

显示通知

Implementation

static void showNotification({
  ToastBuilder? leading,
  ToastBuilder? title,
  ToastBuilder? subtitle,
  ToastBuilder? trailing,
  WrapAnimation? wrapAnimation,
  WrapAnimation? wrapToastAnimation,
  GestureTapCallback? onTap,
  Color? backgroundColor,
  double? borderRadius,
  GestureLongPressCallback? onLongPress,
  Alignment? align,
  BackButtonBehavior? backButtonBehavior,
  Duration? duration,
  Duration? animationDuration,
  Duration? animationReverseDuration,
  EdgeInsetsGeometry? contentPadding,
  EdgeInsetsGeometry? margin,
  VoidCallback? onClose,
  bool crossPage = true,
  bool onlyOne = true,
  bool enableSlideOff = true,
}) {
  BotToast.showNotification(
    leading: leading,
    title: title,
    subtitle: subtitle,
    trailing: trailing,
    wrapAnimation: wrapAnimation,
    wrapToastAnimation: (controller, cancel, Widget child) => CustomAnimationWidget(
      controller: controller,
      child: child,
    ),
    onTap: onTap,
    backgroundColor: backgroundColor,
    borderRadius: borderRadius ?? AppTheme.radius,
    onLongPress: onLongPress,
    align: align ?? const Alignment(0, 0.96),
    backButtonBehavior: backButtonBehavior,
    duration: duration ?? const Duration(seconds: 4),
    animationDuration: animationDuration,
    animationReverseDuration: animationReverseDuration,
    contentPadding: contentPadding ?? EdgeInsets.symmetric(horizontal: AppTheme.padding),
    margin: margin ?? EdgeInsets.symmetric(horizontal: AppTheme.margin),
    onClose: onClose,
    crossPage: crossPage,
    onlyOne: onlyOne,
    enableSlideOff: enableSlideOff,
  );
}