yummySnackBar function

SnackBar yummySnackBar(
  1. {Color? backgroundColor,
  2. Icon? icon,
  3. required String message,
  4. bool showCloseIcon = true,
  5. EdgeInsetsGeometry? margin = const EdgeInsets.only(left: 40, right: 40, top: 2, bottom: 2),
  6. Duration duration = const Duration(milliseconds: 2400),
  7. TextStyle textStyle = const TextStyle(fontWeight: FontWeight.w700, fontSize: 16, color: Colors.black)}
)

Implementation

@pragma("vm:prefer-inline")
SnackBar yummySnackBar(
        {Color? backgroundColor,
        Icon? icon,
        required String message,
        bool showCloseIcon = true,
        EdgeInsetsGeometry? margin = const EdgeInsets.only(
            left: 40, right: 40, top: 2, bottom: 2),
        Duration duration = const Duration(milliseconds: 2400),
        TextStyle textStyle = const TextStyle(
            fontWeight: FontWeight.w700,
            fontSize: 16,
            color: Colors.black)}) =>
    SnackBar(
        backgroundColor: backgroundColor,
        behavior: SnackBarBehavior.fixed,
        margin: margin,
        duration: duration,
        showCloseIcon: showCloseIcon,
        shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(8)),
        content: Tooltip(
          message: message,
          child: Row(children: <Widget>[
            if (icon != null) icon,
            const SizedBox(width: 30),
            Text(message,
                style: textStyle, overflow: TextOverflow.ellipsis)
          ]),
        ));