showSnackBar method
void showSnackBar (String message, {Duration duration = const Duration(seconds: 2)})
This is used for the quick alert of duration: 2 seconds
with text message(passed).
Implementation
void showSnackBar(
String message, {
Duration duration = const Duration(seconds: 2),
}) {
ScaffoldMessenger.of(navigatorKey.currentContext!).showSnackBar(
SnackBar(
behavior: SnackBarBehavior.floating,
duration: duration,
content: Text(message),
),
);
}