tab close undo

This commit is contained in:
Fabian Freund
2025-08-24 12:22:15 +02:00
parent 84578b6afd
commit bcacc4c1e8
10 changed files with 114 additions and 70 deletions
+17
View File
@@ -148,3 +148,20 @@ Future<void> launchUrlFeedback(
}
}
}
void showTabUndoClose(
BuildContext context,
VoidCallback onUndo, {
int count = 1,
Duration duration = const Duration(seconds: 2),
}) {
final snackBar = SnackBar(
content: (count > 1)
? Text('$count Tabs closed')
: const Text('Tab closed'),
action: SnackBarAction(label: 'Undo', onPressed: onUndo),
duration: duration,
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}