showSnackBar static method

void showSnackBar(
  1. BuildContext context,
  2. String message, {
  3. double? bottom,
  4. String? actionLabel,
  5. bool showCloseIcon = true,
  6. Duration duration = const Duration(seconds: 3),
  7. Function? onActionPressed,
  8. Function? onClosed,
})

Implementation

static void showSnackBar(BuildContext context, String message,
    {
    /// margin from bottom of navbar defaults to [kNavbarHeight]
    double? bottom,
    String? actionLabel,
    bool showCloseIcon = true,
    Duration duration = const Duration(seconds: 3),
    Function? onActionPressed,
    Function? onClosed}) {
  _showMessage(
    context,
    message,
    showCloseIcon: showCloseIcon,
    actionLabel: actionLabel,
    bottom: bottom ?? kNavbarHeight,
    duration: duration,
    onPressed: () {
      if (onActionPressed != null) {
        onActionPressed();
      }
    },
    onClosed: () {
      if (onClosed != null) {
        onClosed();
      }
    },
  );
}