feat: Refactor routing and navigation structure with StatefulShellRoute
Test Suite / test (24.15.0) (push) Has been cancelled

- Introduced a new function `_shellBranchIndexForPath` to determine the index of the shell branch based on the path.
- Replaced `ShellRoute` with `StatefulShellRoute.indexedStack` for better state management during navigation.
- Updated `AppShell` to handle navigation path changes and integrate with the new routing structure.
- Organized routes into `StatefulShellBranch` for better modularity and clarity.
- Enhanced admin panel functionality with improved alias management and UI updates.
- Added new methods in `ReceiptImportSessionNotifier` for managing selected items and edits more efficiently.
- Improved UI components in receipt import and admin panels for better performance and user experience.
- Added PageStorageKeys to various ListViews to maintain scroll positions across navigation.
- Documented performance goals and profiling strategies in a new PERFORMANCE.md file.
This commit is contained in:
Nils-Johan Gynther
2026-05-08 12:51:38 +02:00
parent 73309cb110
commit 0873fa42bb
12 changed files with 625 additions and 285 deletions
+4 -2
View File
@@ -21,11 +21,13 @@ const _adminHeaderDestination = _AppDestination(
class AppShell extends ConsumerWidget {
final String location;
final ValueChanged<String> onNavigateToPath;
final Widget child;
const AppShell({
super.key,
required this.location,
required this.onNavigateToPath,
required this.child,
});
@@ -101,7 +103,7 @@ class AppShell extends ConsumerWidget {
void navigateTo(int index) {
final target = dests[index].path;
if (target != location && context.mounted) {
context.go(target);
onNavigateToPath(target);
}
}
@@ -178,7 +180,7 @@ class AppShell extends ConsumerWidget {
switch (value) {
case 'profile':
if (location != '/profile' && context.mounted) {
context.go('/profile');
onNavigateToPath('/profile');
}
}
},