ensured timetable visibility on widget navigation by resetting root navigator
This commit is contained in:
@@ -65,6 +65,14 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||||||
Future<void> _handlePendingWidgetNavigation() async {
|
Future<void> _handlePendingWidgetNavigation() async {
|
||||||
final pending = await WidgetNavigation.consumePendingTimetableTap();
|
final pending = await WidgetNavigation.consumePendingTimetableTap();
|
||||||
if (!pending || !mounted) return;
|
if (!pending || !mounted) return;
|
||||||
|
// Routes pushed with `withNavBar: false` (chat views, file viewers, …)
|
||||||
|
// sit on the root navigator above the bottom-nav, so a bare jumpToTab
|
||||||
|
// would swap the tab behind them and leave the user staring at the
|
||||||
|
// previous screen. Reset to the tab root first.
|
||||||
|
final navigator = Navigator.of(context);
|
||||||
|
if (navigator.canPop()) {
|
||||||
|
navigator.popUntil((route) => route.isFirst);
|
||||||
|
}
|
||||||
AppRoutes.goToTab(context, Modules.timetable);
|
AppRoutes.goToTab(context, Modules.timetable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user