Refactor code structure for improved readability and maintainability
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user