feat: update RecipesViewNotifier and RecipesScreen to use maybeWhen for safer state handling
This commit is contained in:
@@ -105,11 +105,13 @@ class AppShell extends ConsumerWidget {
|
||||
appBar: AppBar(
|
||||
title: Text(selectedDestination.title),
|
||||
actions: [
|
||||
if (isRecipesRoute) ...existing code...
|
||||
if (isRecipesRoute)
|
||||
Consumer(
|
||||
builder: (context, ref, child) {
|
||||
final view = ref.watch(recipesViewProvider).valueOrNull ??
|
||||
(mode: RecipesViewMode.grid, columns: 2);
|
||||
final view = ref.watch(recipesViewProvider).maybeWhen(
|
||||
data: (v) => v,
|
||||
orElse: () => (mode: RecipesViewMode.grid, columns: 2),
|
||||
);
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user