SmoothFloatingSnackbar.positive constructor
SmoothFloatingSnackbar.positive({ - required BuildContext context,
- required String text,
- double? elevation,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- double? width,
- ShapeBorder? shape,
- HitTestBehavior? hitTestBehavior,
- SnackBarAction? action,
- double? actionOverflowThreshold,
- bool? showCloseIcon,
- Color? closeIconColor,
- Animation<double>? animation,
- VoidCallback? onVisible,
- DismissDirection? dismissDirection,
- Clip clipBehavior = Clip.hardEdge,
- Duration? duration,
- Key? key,
})
Implementation
SmoothFloatingSnackbar.positive({
required BuildContext context,
required String text,
super.elevation,
EdgeInsetsGeometry? margin,
super.padding,
super.width,
super.shape,
super.hitTestBehavior,
super.action,
super.actionOverflowThreshold,
super.showCloseIcon,
super.closeIconColor,
super.animation,
super.onVisible,
super.dismissDirection,
super.clipBehavior = Clip.hardEdge,
Duration? duration,
super.key,
}) : super(
margin: margin ?? const EdgeInsetsDirectional.all(SMALL_SPACE),
duration:
duration ??
(action != null
? const Duration(seconds: 10)
: SnackBarDuration.short),
behavior: SnackBarBehavior.floating,
backgroundColor: context
.extension<SmoothColorsThemeExtension>()
.success,
content: Row(
children: <Widget>[
Expanded(child: Text(text)),
const SizedBox(width: SMALL_SPACE),
const Icon(Icons.check_circle, color: Colors.white),
],
),
);