feat: upgrade Riverpod 3, go_router 17, google_fonts 8, package_info_plus 9
Migrate StateNotifierProvider/StateNotifier → NotifierProvider/Notifier, StateProvider → NotifierProvider with simple notifier, FamilyAsyncNotifier removed in Riverpod 3 (replaced with constructor-arg pattern), and rename .valueOrNull → .value throughout all providers and screens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,7 @@ class NotesNotifier extends AsyncNotifier<List<Note>> {
|
||||
final note = await ref
|
||||
.read(notesRepositoryProvider)
|
||||
.create(title, body, tags: tags, projectId: projectId);
|
||||
state = AsyncData([...state.valueOrNull ?? [], note]);
|
||||
state = AsyncData([...state.value ?? [], note]);
|
||||
return note;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class NotesNotifier extends AsyncNotifier<List<Note>> {
|
||||
clearProject: clearProject,
|
||||
);
|
||||
state = AsyncData([
|
||||
for (final n in state.valueOrNull ?? [])
|
||||
for (final n in state.value ?? [])
|
||||
if (n.id == id) updated else n,
|
||||
]);
|
||||
return updated;
|
||||
@@ -51,7 +51,7 @@ class NotesNotifier extends AsyncNotifier<List<Note>> {
|
||||
Future<void> delete(int id) async {
|
||||
await ref.read(notesRepositoryProvider).delete(id);
|
||||
state = AsyncData([
|
||||
for (final n in state.valueOrNull ?? [])
|
||||
for (final n in state.value ?? [])
|
||||
if (n.id != id) n,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user