rawSnackBar method
SnackbarController
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,
- Widget? mainButton,
- OnTap? onTap,
- Duration? duration = const Duration(seconds: 3),
- bool isDismissible = true,
- DismissDirection? dismissDirection,
- 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,
Implementation
SnackbarController 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,
Widget? mainButton,
OnTap? onTap,
Duration? duration = const Duration(seconds: 3),
bool isDismissible = true,
DismissDirection? dismissDirection,
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 getSnackBar = GetSnackBar(
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,
progressIndicatorController: progressIndicatorController,
progressIndicatorBackgroundColor: progressIndicatorBackgroundColor,
progressIndicatorValueColor: progressIndicatorValueColor,
snackStyle: snackStyle,
forwardAnimationCurve: forwardAnimationCurve,
reverseAnimationCurve: reverseAnimationCurve,
animationDuration: animationDuration,
overlayBlur: overlayBlur,
overlayColor: overlayColor,
userInputForm: userInputForm,
);
final controller = SnackbarController(getSnackBar);
if (instantInit) {
controller.show();
} else {
ambiguate(SchedulerBinding.instance)?.addPostFrameCallback((_) {
controller.show();
});
}
return controller;
}