showSnackException static method
void
showSnackException(
- String message,
- Color color, {
- required BuildContext context,
- int seconds = 5,
Implementation
static void showSnackException(
String message,
Color color, {
required BuildContext context,
int seconds = 5,
}) {
FocusScope.of(context).requestFocus(
FocusNode(),
);
ScaffoldMessenger.of(context).removeCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
message,
style: const TextStyle(color: Colors.white),
),
backgroundColor: color,
duration: Duration(
seconds: seconds,
),
),
);
}