showTextBar method

void showTextBar(
  1. String text, [
  2. SnackBarBehavior? behavior
])

Shows a snackbar with the specified text message.

The text parameter specifies the text to be displayed in the snackbar.

Implementation

void showTextBar(String text, [SnackBarBehavior? behavior]) {
  ScaffoldMessenger.of(this)
    ..hideCurrentSnackBar()
    ..showSnackBar(
      SnackBar(content: Text(text), behavior: behavior),
    );
}