showSnackBar function

void showSnackBar(
  1. String msg
)

showSnackBar

Description: showSnackBar without BuildContext

Parameters:

  • String msg: Message to display

Example Usage:

showSnackBar(msg: "Snack bar");

Implementation

void showSnackBar(String msg) {
  try {
    final SnackBar snackBar = SnackBar(content: Text(msg));
    snackbarKey.currentState?.showSnackBar(snackBar);
  } catch (e, stackTrace) {
    message.throwError(e: e, stackTrace: stackTrace);
  }
}