Refactor code structure for improved readability and maintainability

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Nils-Johan Gynther
2026-04-23 21:14:46 +02:00
parent cd4274575e
commit db1128ceaf
49 changed files with 285993 additions and 175 deletions
@@ -254,8 +254,8 @@ class _PantryScreenState extends ConsumerState<PantryScreen> {
);
}
final pantryItems = pantryAsync.valueOrNull ?? const [];
final products = productsAsync.valueOrNull ?? const [];
final pantryItems = pantryAsync.maybeWhen(data: (d) => d, orElse: () => null) ?? const [];
final products = productsAsync.maybeWhen(data: (d) => d, orElse: () => null) ?? const [];
final productById = {for (final product in products) product.id: product};
final pantryProductIds = pantryItems.map((e) => e.productId).toSet();
final availableProducts = products