show static method
void
show(
- String message, {
- String? title,
- GpSemanticTone tone = GpSemanticTone.neutral,
- Duration duration = const Duration(seconds: 4),
- Color? backgroundColor,
- Color? textColor,
- BuildContext? context,
Muestra un SnackBar simple con texto personalizado.
Implementation
static void show(
String message, {
String? title,
GpSemanticTone tone = GpSemanticTone.neutral,
Duration duration = const Duration(seconds: 4),
Color? backgroundColor,
Color? textColor,
BuildContext? context,
}) {
final snackBar = _buildSnackBar(
message,
title: title,
tone: tone,
duration: duration,
backgroundColor: backgroundColor,
textColor: textColor,
context: context,
);
if (context != null) {
ScaffoldMessenger.of(context).showSnackBar(snackBar);
return;
}
final scaffoldMessenger =
GpScaffoldMessenger.scaffoldMessengerKey.currentState;
if (scaffoldMessenger != null) {
scaffoldMessenger.showSnackBar(snackBar);
}
}