check for empty route stack

This commit is contained in:
Fabian Freund
2026-02-06 06:06:26 +01:00
parent d7e635782b
commit fa42e124c7
+6 -1
View File
@@ -62,8 +62,13 @@ class CurrentTopRoute extends _$CurrentTopRoute {
void update() {
final config = router.routerDelegate.currentConfiguration;
final match = config.last;
if (config.isEmpty) {
state = null;
return;
}
final match = config.last;
state = match.route;
}