File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ void showTabOpenedMessage(
6161 BuildContext context, {
6262 String ? tabName,
6363 void Function ()? onShow,
64+ Duration duration = const Duration (seconds: 3 ),
6465}) {
6566 final message = switch (tabName.whenNotEmpty) {
6667 String () => "New tab '$tabName ' opened in background" ,
@@ -72,6 +73,7 @@ void showTabOpenedMessage(
7273 action: onShow.mapNotNull (
7374 (onPressed) => SnackBarAction (label: 'Show' , onPressed: onPressed),
7475 ),
76+ duration: duration,
7577 );
7678
7779 ScaffoldMessenger .of (context).showSnackBar (snackBar);
@@ -106,6 +108,7 @@ void showTabSwitchMessage(
106108 BuildContext context, {
107109 String ? tabName,
108110 void Function ()? onSwitch,
111+ Duration duration = const Duration (seconds: 3 ),
109112}) {
110113 ScaffoldMessenger .of (context).clearSnackBars ();
111114
@@ -119,6 +122,7 @@ void showTabSwitchMessage(
119122 action: onSwitch.mapNotNull (
120123 (onPressed) => SnackBarAction (label: 'Switch' , onPressed: onPressed),
121124 ),
125+ duration: duration,
122126 );
123127
124128 ScaffoldMessenger .of (context).showSnackBar (snackBar);
You can’t perform that action at this time.
0 commit comments