show static method

bool show({
  1. Widget? widget,
  2. SnackBarAction? action,
})

Implementation

static bool show({Widget? widget, SnackBarAction? action}) {
  if (rootScaffoldMessengerKey == null) return false;

  try {
    rootScaffoldMessengerKey!.currentState!.hideCurrentSnackBar();
    rootScaffoldMessengerKey!.currentState!.showSnackBar(SnackBar(
      content: widget!,
      action: action,
    ));
  } catch (e) {}
  return true;
}