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:
@@ -28,14 +28,14 @@ class TasksNotifier extends AsyncNotifier<List<Task>> {
|
||||
dueDate: dueDate,
|
||||
projectId: projectId,
|
||||
);
|
||||
state = AsyncData([...state.valueOrNull ?? [], task]);
|
||||
state = AsyncData([...state.value ?? [], task]);
|
||||
return task;
|
||||
}
|
||||
|
||||
Future<Task> updateTask(int id, Map<String, dynamic> fields) async {
|
||||
final updated = await ref.read(tasksRepositoryProvider).update(id, fields);
|
||||
state = AsyncData([
|
||||
for (final t in state.valueOrNull ?? [])
|
||||
for (final t in state.value ?? [])
|
||||
if (t.id == id) updated else t,
|
||||
]);
|
||||
return updated;
|
||||
@@ -44,7 +44,7 @@ class TasksNotifier extends AsyncNotifier<List<Task>> {
|
||||
Future<void> delete(int id) async {
|
||||
await ref.read(tasksRepositoryProvider).delete(id);
|
||||
state = AsyncData([
|
||||
for (final t in state.valueOrNull ?? [])
|
||||
for (final t in state.value ?? [])
|
||||
if (t.id != id) t,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user