SmoothFloatingSnackbar.error constructor

SmoothFloatingSnackbar.error({
  1. required BuildContext context,
  2. required String text,
  3. double? elevation,
  4. EdgeInsetsGeometry? padding,
  5. double? width,
  6. ShapeBorder? shape,
  7. HitTestBehavior? hitTestBehavior,
  8. SnackBarAction? action,
  9. double? actionOverflowThreshold,
  10. bool? showCloseIcon,
  11. Color? closeIconColor,
  12. Animation<double>? animation,
  13. VoidCallback? onVisible,
  14. DismissDirection? dismissDirection,
  15. Clip clipBehavior = Clip.hardEdge,
  16. Duration? duration,
  17. Key? key,
})

Implementation

SmoothFloatingSnackbar.error({
  required BuildContext context,
  required String text,
  super.elevation,
  super.padding,
  super.width,
  super.shape,
  super.hitTestBehavior,
  SnackBarAction? action,
  super.actionOverflowThreshold,
  super.showCloseIcon,
  super.closeIconColor,
  super.animation,
  super.onVisible,
  super.dismissDirection,
  super.clipBehavior = Clip.hardEdge,
  Duration? duration,
  super.key,
}) : super(
       margin: const EdgeInsetsDirectional.all(SMALL_SPACE),
       duration:
           duration ??
           (action != null
               ? const Duration(seconds: 10)
               : SnackBarDuration.short),
       behavior: SnackBarBehavior.floating,
       backgroundColor: context.extension<SmoothColorsThemeExtension>().error,
       action: action?.copyWith(
         backgroundColor: Colors.white38,
         textColor: Colors.white,
       ),
       content: Row(
         children: <Widget>[
           ExcludeSemantics(
             child: DecoratedBox(
               decoration: const BoxDecoration(
                 color: Colors.white,
                 shape: BoxShape.circle,
               ),
               child: Padding(
                 padding: const EdgeInsetsDirectional.only(
                   start: 6.0,
                   end: SMALL_SPACE,
                   top: 6.5,
                   bottom: SMALL_SPACE,
                 ),
                 child: Builder(
                   builder: (BuildContext context) {
                     return icons.Warning(
                       color: context
                           .extension<SmoothColorsThemeExtension>()
                           .error,
                       size: 15.0,
                     );
                   },
                 ),
               ),
             ),
           ),
           const SizedBox(width: LARGE_SPACE),
           Expanded(child: Text(text)),
         ],
       ),
     );