show method
void
show(
- ScaffoldMessengerState state, {
- required String message,
- int duration = 1,
- bool isSuccess = true,
Implementation
void show(
ScaffoldMessengerState state, {
required String message,
int duration = 1, // second
bool isSuccess = true,
}) {
state.removeCurrentSnackBar();
SnackBar sn = SnackBar(
content: Text(
message,
style: TextStyle(
color: Colors.white,
fontSize: FontSize.medium(),
),
),
duration: Duration(seconds: duration),
backgroundColor: isSuccess ? Colors.green : Colors.red,
);
state.showSnackBar(sn);
}