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:
@@ -99,6 +99,7 @@ class InventoryScreen extends ConsumerWidget {
|
||||
return Stack(
|
||||
children: [
|
||||
ListView(
|
||||
key: const PageStorageKey<String>('inventory-empty-list'),
|
||||
padding: const EdgeInsets.only(bottom: 88),
|
||||
children: [
|
||||
filterSection,
|
||||
@@ -109,6 +110,7 @@ class InventoryScreen extends ConsumerWidget {
|
||||
right: 16,
|
||||
bottom: 16,
|
||||
child: FloatingActionButton.extended(
|
||||
heroTag: 'inventory_add_empty',
|
||||
onPressed: () => context.push('/inventory/create'),
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(context.l10n.addAction),
|
||||
@@ -120,6 +122,7 @@ class InventoryScreen extends ConsumerWidget {
|
||||
return Stack(
|
||||
children: [
|
||||
ListView.separated(
|
||||
key: const PageStorageKey<String>('inventory-main-list'),
|
||||
padding: const EdgeInsets.only(bottom: 88),
|
||||
itemCount: visibleItems.length + 1,
|
||||
separatorBuilder: (_, __) => const Divider(height: 1),
|
||||
@@ -136,12 +139,14 @@ class InventoryScreen extends ConsumerWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FloatingActionButton.extended(
|
||||
heroTag: 'inventory_add',
|
||||
onPressed: () => context.push('/inventory/create'),
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(context.l10n.addAction),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
FloatingActionButton.extended(
|
||||
heroTag: 'inventory_go_recipes',
|
||||
onPressed: () => context.go('/recipes'),
|
||||
icon: const Icon(Icons.restaurant_menu),
|
||||
label: Text(context.l10n.inventoryRecipesAction),
|
||||
|
||||
Reference in New Issue
Block a user