clear snackbars before showing new ones

This commit is contained in:
Fabian Freund
2025-09-10 10:22:34 +02:00
parent 82f687b5b1
commit 4f37be28e6
+4
View File
@@ -116,6 +116,8 @@ void showTabSwitchMessage(
String? tabName,
void Function()? onSwitch,
}) {
ScaffoldMessenger.of(context).clearSnackBars();
final message = switch (tabName.whenNotEmpty) {
String() => "New tab '$tabName' opened",
null => 'New tab opened',
@@ -155,6 +157,8 @@ void showTabUndoClose(
int count = 1,
Duration duration = const Duration(seconds: 2),
}) {
ScaffoldMessenger.of(context).clearSnackBars();
final snackBar = SnackBar(
content: (count > 1)
? Text('$count Tabs closed')