Refactor category handling in inventory and pantry forms
Test Suite / test (24.15.0) (push) Has been cancelled
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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user