feat: Refactor routing and navigation structure with StatefulShellRoute
Test Suite / test (24.15.0) (push) Has been cancelled
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:
@@ -325,6 +325,7 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
|
||||
final content = filteredItems.isEmpty
|
||||
? ListView(
|
||||
key: const PageStorageKey<String>('pantry-empty-list'),
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 12, 96),
|
||||
children: [
|
||||
filterSection,
|
||||
@@ -335,6 +336,7 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
],
|
||||
)
|
||||
: ListView.separated(
|
||||
key: const PageStorageKey<String>('pantry-main-list'),
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 12, 96),
|
||||
itemCount: filteredItems.length + 1,
|
||||
separatorBuilder: (_, __) => const Divider(height: 1),
|
||||
@@ -384,12 +386,14 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FloatingActionButton.extended(
|
||||
heroTag: 'pantry_add',
|
||||
onPressed: () => context.push('/inventory/create?destination=pantry'),
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(context.l10n.addAction),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
FloatingActionButton.extended(
|
||||
heroTag: 'pantry_go_recipes',
|
||||
onPressed: () => context.go('/recipes'),
|
||||
icon: const Icon(Icons.restaurant_menu),
|
||||
label: Text(context.l10n.inventoryRecipesAction),
|
||||
|
||||
Reference in New Issue
Block a user