fix: migrate to Riverpod 3.x and update dependencies (#175) #190

Merged
guettlibot merged 2 commits from issue-175-fix into main 2026-05-23 17:50:18 +00:00
guettlibot commented 2026-05-23 17:44:50 +00:00 (Migrated from codeberg.org)

Summary

Closes #175.

  • Riverpod 3.x migration: bumps flutter_riverpod to ^3.0.0 (resolves to 3.3.1 / riverpod 3.2.1)
  • StateNotifierNotifier: UndoService rewritten; ref is now built-in, build() returns initial state, no constructor Ref parameter
  • AutoDisposeFamilyAsyncNotifier removed: EmailDetailNotifier converted to AsyncNotifier with the email ID passed via constructor so the existing family declaration continues to work
  • AsyncValue.valueOrNull removed: replaced with .value in email_list_screen and email_detail_screen (.value now returns null for errors in v3)
  • Override type: imported from flutter_riverpod/misc.dart in every file that uses it as a type annotation (no longer re-exported from the main barrel)
  • syncLogRepositoryProvider typed as Provider<SyncLogRepository>: makes the provider accept any SyncLogRepository implementation at the boundary
  • Widget-test pending-timer fix: buildApp() in test/widget/helpers.dart now adds default no-op overrides for syncHealthProvider and syncLogRepositoryProvider before test-specific overrides. This prevents Drift StreamQuery cache-debouncing timers from being pending at test teardown (all 444 unit + widget tests pass)

Test plan

  • flutter analyze — no issues
  • flutter test test/unit/ test/widget/ — 444 tests pass (327 unit, 117 widget)
## Summary Closes #175. - **Riverpod 3.x migration**: bumps `flutter_riverpod` to `^3.0.0` (resolves to 3.3.1 / riverpod 3.2.1) - **`StateNotifier` → `Notifier`**: `UndoService` rewritten; `ref` is now built-in, `build()` returns initial state, no constructor `Ref` parameter - **`AutoDisposeFamilyAsyncNotifier` removed**: `EmailDetailNotifier` converted to `AsyncNotifier` with the email ID passed via constructor so the existing `family` declaration continues to work - **`AsyncValue.valueOrNull` removed**: replaced with `.value` in `email_list_screen` and `email_detail_screen` (`.value` now returns `null` for errors in v3) - **`Override` type**: imported from `flutter_riverpod/misc.dart` in every file that uses it as a type annotation (no longer re-exported from the main barrel) - **`syncLogRepositoryProvider` typed as `Provider<SyncLogRepository>`**: makes the provider accept any `SyncLogRepository` implementation at the boundary - **Widget-test pending-timer fix**: `buildApp()` in `test/widget/helpers.dart` now adds default no-op overrides for `syncHealthProvider` and `syncLogRepositoryProvider` before test-specific overrides. This prevents Drift `StreamQuery` cache-debouncing timers from being pending at test teardown (all 444 unit + widget tests pass) ## Test plan - [x] `flutter analyze` — no issues - [x] `flutter test test/unit/ test/widget/` — 444 tests pass (327 unit, 117 widget)
Sign in to join this conversation.