showSnackbarText method

void showSnackbarText({
  1. required Object themeOrId,
  2. required Object text,
  3. Duration duration = const Duration(seconds: 2),
})
inherited

Show a snackbar.

Shows a snackbar containing the specified text.

See also showSnackbarText

Implementation

void showSnackbarText({
  required Object themeOrId,
  required Object text,
  Duration duration = const Duration(seconds: 2)
}) {
  var themeActual = _findTheme(themeOrId);
  final ctx = flutterContext;
  if(ctx != null) {
    ScaffoldMessenger.of(ctx).showSnackBar(SnackBar(
      content: themeActual.childText(text: text),
      duration: duration
    ));
  }
}