refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2025-03-24 19:50:59 -05:00
parent b051acfb64
commit ed59cbb91e

View File

@ -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) {