clear snackbars before showing new ones
This commit is contained in:
@@ -116,6 +116,8 @@ void showTabSwitchMessage(
|
|||||||
String? tabName,
|
String? tabName,
|
||||||
void Function()? onSwitch,
|
void Function()? onSwitch,
|
||||||
}) {
|
}) {
|
||||||
|
ScaffoldMessenger.of(context).clearSnackBars();
|
||||||
|
|
||||||
final message = switch (tabName.whenNotEmpty) {
|
final message = switch (tabName.whenNotEmpty) {
|
||||||
String() => "New tab '$tabName' opened",
|
String() => "New tab '$tabName' opened",
|
||||||
null => 'New tab opened',
|
null => 'New tab opened',
|
||||||
@@ -155,6 +157,8 @@ void showTabUndoClose(
|
|||||||
int count = 1,
|
int count = 1,
|
||||||
Duration duration = const Duration(seconds: 2),
|
Duration duration = const Duration(seconds: 2),
|
||||||
}) {
|
}) {
|
||||||
|
ScaffoldMessenger.of(context).clearSnackBars();
|
||||||
|
|
||||||
final snackBar = SnackBar(
|
final snackBar = SnackBar(
|
||||||
content: (count > 1)
|
content: (count > 1)
|
||||||
? Text('$count Tabs closed')
|
? Text('$count Tabs closed')
|
||||||
|
|||||||
Reference in New Issue
Block a user