Refactor category handling in inventory and pantry forms
Test Suite / test (24.15.0) (push) Has been cancelled

- Introduced `_categorySearchController` and `_categoryOptions` in both `_InventoryFormDialogState` and `_PantryFormDialogState` to manage category selection more effectively.
- Implemented `_flattenCategoryOptions` method to create a flat list of category options from nested category nodes.
- Updated the initialization and disposal of the new controllers to ensure proper resource management.
- Made minor adjustments to the PopupMenuItem definitions in `AppShell` for consistency.
This commit is contained in:
Nils-Johan Gynther
2026-05-11 17:03:58 +02:00
parent d038d30831
commit 9b4d1f94bf
6 changed files with 84459 additions and 79916 deletions
+5 -5
View File
@@ -210,8 +210,8 @@ class AppShell extends ConsumerWidget {
break;
}
},
itemBuilder: (context) => const [
PopupMenuItem<String>(
itemBuilder: (context) => [
const PopupMenuItem<String>(
value: 'profile',
child: ListTile(
leading: Icon(Icons.person_outline),
@@ -220,7 +220,7 @@ class AppShell extends ConsumerWidget {
),
),
if (isAdmin)
PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'admin',
child: ListTile(
leading: Icon(Icons.admin_panel_settings_outlined),
@@ -228,8 +228,8 @@ class AppShell extends ConsumerWidget {
contentPadding: EdgeInsets.zero,
),
),
PopupMenuDivider(),
PopupMenuItem<String>(
const PopupMenuDivider(),
const PopupMenuItem<String>(
value: 'logout',
child: ListTile(
leading: Icon(Icons.logout),