rawSnackbar static method

SnackbarController rawSnackbar({
  1. String? title,
  2. String? message,
  3. Widget? titleText,
  4. Widget? messageText,
  5. Widget? icon,
  6. bool shouldIconPulse = true,
  7. double? maxWidth,
  8. EdgeInsets margin = const EdgeInsets.all(0.0),
  9. EdgeInsets padding = const EdgeInsets.all(16),
  10. double borderRadius = 0.0,
  11. Color? borderColor,
  12. double borderWidth = 1.0,
  13. Color backgroundColor = const Color(0xFF303030),
  14. Color? leftBarIndicatorColor,
  15. List<BoxShadow>? boxShadows,
  16. Gradient? backgroundGradient,
  17. Widget? mainButton,
  18. OnTap? onTap,
  19. Duration? duration = const Duration(seconds: 3),
  20. bool isDismissible = true,
  21. bool showProgressIndicator = false,
  22. AnimationController? progressIndicatorController,
  23. Color? progressIndicatorBackgroundColor,
  24. Animation<Color>? progressIndicatorValueColor,
  25. SnackPosition snackPosition = SnackPosition.bottom,
  26. SnackStyle snackStyle = SnackStyle.floating,
  27. Curve forwardAnimationCurve = Curves.easeOutCirc,
  28. Curve reverseAnimationCurve = Curves.easeOutCirc,
  29. Duration animationDuration = const Duration(seconds: 1),
  30. SnackbarStatusCallback? snackbarStatus,
  31. double barBlur = 0.0,
  32. double overlayBlur = 0.0,
  33. Color? overlayColor,
  34. Form? userInputForm,
})

Show a raw snackbar

Implementation

static SnackbarController rawSnackbar({
  String? title,
  String? message,
  Widget? titleText,
  Widget? messageText,
  Widget? icon,
  bool shouldIconPulse = true,
  double? maxWidth,
  EdgeInsets margin = const EdgeInsets.all(0.0),
  EdgeInsets padding = const EdgeInsets.all(16),
  double borderRadius = 0.0,
  Color? borderColor,
  double borderWidth = 1.0,
  Color backgroundColor = const Color(0xFF303030),
  Color? leftBarIndicatorColor,
  List<BoxShadow>? boxShadows,
  Gradient? backgroundGradient,
  Widget? mainButton,
  OnTap? onTap,
  Duration? duration = const Duration(seconds: 3),
  bool isDismissible = true,
  bool showProgressIndicator = false,
  AnimationController? progressIndicatorController,
  Color? progressIndicatorBackgroundColor,
  Animation<Color>? progressIndicatorValueColor,
  SnackPosition snackPosition = SnackPosition.bottom,
  SnackStyle snackStyle = SnackStyle.floating,
  Curve forwardAnimationCurve = Curves.easeOutCirc,
  Curve reverseAnimationCurve = Curves.easeOutCirc,
  Duration animationDuration = const Duration(seconds: 1),
  SnackbarStatusCallback? snackbarStatus,
  double barBlur = 0.0,
  double overlayBlur = 0.0,
  Color? overlayColor,
  Form? userInputForm,
}) {
  final flowSnackBar = FlowsSnackBar(
    snackbarStatus: snackbarStatus,
    title: title,
    message: message,
    titleText: titleText,
    messageText: messageText,
    snackPosition: snackPosition,
    borderRadius: borderRadius,
    margin: margin,
    duration: duration,
    barBlur: barBlur,
    backgroundColor: backgroundColor,
    icon: icon,
    shouldIconPulse: shouldIconPulse,
    maxWidth: maxWidth,
    padding: padding,
    borderColor: borderColor,
    borderWidth: borderWidth,
    leftBarIndicatorColor: leftBarIndicatorColor,
    boxShadows: boxShadows,
    backgroundGradient: backgroundGradient,
    mainButton: mainButton,
    onTap: onTap,
    isDismissible: isDismissible,
    showProgressIndicator: showProgressIndicator,
    progressIndicatorController: progressIndicatorController,
    progressIndicatorBackgroundColor: progressIndicatorBackgroundColor,
    progressIndicatorValueColor: progressIndicatorValueColor,
    snackStyle: snackStyle,
    forwardAnimationCurve: forwardAnimationCurve,
    reverseAnimationCurve: reverseAnimationCurve,
    animationDuration: animationDuration,
    overlayBlur: overlayBlur,
    overlayColor: overlayColor,
    userInputForm: userInputForm,
  );

  final controller = SnackbarController(flowSnackBar);
  // Delay showing snackbar until next frame to ensure Overlay is available
  WidgetsBinding.instance.endOfFrame.then((_) {
    controller.show();
  });
  return controller;
}