This commit is contained in:
parent
b051acfb64
commit
ed59cbb91e
@ -115,17 +115,23 @@ void displayAuthError(Auth auth) {
|
|||||||
displayErrorMessage(
|
displayErrorMessage(
|
||||||
constants.navigatorKey.currentContext!,
|
constants.navigatorKey.currentContext!,
|
||||||
"Authentication failed",
|
"Authentication failed",
|
||||||
|
clear: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayErrorMessage(context, String text) {
|
void displayErrorMessage(context, String text, {bool clear = false}) {
|
||||||
if (!context.mounted) {
|
if (!context.mounted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScaffoldMessenger.of(
|
final messenger = ScaffoldMessenger.of(context);
|
||||||
context,
|
if (clear) {
|
||||||
).showSnackBar(SnackBar(content: Text(text, textAlign: TextAlign.center)));
|
messenger.removeCurrentSnackBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
messenger.showSnackBar(
|
||||||
|
SnackBar(content: Text(text, textAlign: TextAlign.center)),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String formatMountName(String type, String name) {
|
String formatMountName(String type, String name) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user