rawSnackbar method

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

Implementation

void rawSnackbar({
  String title,
  String message,
  Widget titleText,
  Widget messageText,
  Widget icon,
  bool instantInit = true,
  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,
  FlatButton mainButton,
  OnTap onTap,
  Duration duration = const Duration(seconds: 3),
  bool isDismissible = true,
  SnackDismissDirection dismissDirection = SnackDismissDirection.VERTICAL,
  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,
}) async {
  final getBar = GetBar(
    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,
    dismissDirection: dismissDirection,
    showProgressIndicator: showProgressIndicator ?? false,
    progressIndicatorController: progressIndicatorController,
    progressIndicatorBackgroundColor: progressIndicatorBackgroundColor,
    progressIndicatorValueColor: progressIndicatorValueColor,
    snackStyle: snackStyle,
    forwardAnimationCurve: forwardAnimationCurve,
    reverseAnimationCurve: reverseAnimationCurve,
    animationDuration: animationDuration,
    overlayBlur: overlayBlur,
    overlayColor: overlayColor,
    userInputForm: userInputForm,
  );

  if (instantInit) {
    getBar.show();
  } else {
    SchedulerBinding.instance.addPostFrameCallback((_) {
      getBar.show();
    });
  }
}