mirror of
https://github.com/linagora/tmail-flutter.git
synced 2026-12-06 08:06:47 +00:00
TF-5022 Name RiverpodActiveAccountSource, ActiveAccountSource and ActiveAccountWriter in the ADR-0092 exception and drop the fixed call-site count
This commit is contained in:
1 parent
c534bae8af
commit
b87cd2dedd
1 file changed
+4
-4
@@ -203,9 +203,9 @@ notifier = container.read(composerAutoSaveProvider('test-id').notifier);
|
||||
|
||||
`appProviderContainer` is frozen. No new `.read()` / `.listen()` / `.invalidate()` calls may be added to it. New features that need Riverpod state must use `ConsumerWidget` + `ref.watch/read` against the widget tree scope.
|
||||
|
||||
One exception is recorded by [ADR-0114](./0114-delegated-mailbox-access.md). `DelegationBindings` hands the container once to `ActiveAccountBridge`, the only GetX access to the shown account. Its readers are GetX controllers with no `WidgetRef`, and the dashboard must write each session synchronously before any of them runs, which a delegate mounted by a view cannot guarantee.
|
||||
One exception is recorded by [ADR-0114](./0114-delegated-mailbox-access.md). `DelegationBindings` hands the container once to `RiverpodActiveAccountSource`, registered as `ActiveAccountSource` and `ActiveAccountWriter`, the only GetX access to the shown account. Its readers are GetX controllers with no `WidgetRef`, and the dashboard must write each session synchronously before any of them runs, which a delegate mounted by a view cannot guarantee.
|
||||
|
||||
### Six existing call sites to migrate
|
||||
### Existing call sites to migrate
|
||||
|
||||
| File | Operation | Migration target |
|
||||
|---|---|---|
|
||||
@@ -215,9 +215,9 @@ One exception is recorded by [ADR-0114](./0114-delegated-mailbox-access.md). `De
|
||||
| `SearchEmailController` | `.read(localSettingsProvider)` | Migrate to `ConsumerWidget` + `ref.watch` |
|
||||
| `HandleMobileAutoSaveExtension` | `.read(composerAutoSaveProvider(id).notifier)` + `.invalidate(...)` | Migrate composer to `ConsumerStatefulWidget` |
|
||||
| `HandleComposerRestoreOnMobileExtension` | `.read(resolveComposerCacheForRestoreProvider)` | Migrate to `ref.read` within a `ConsumerWidget` |
|
||||
| `DelegationBindings` | Container handed to `ActiveAccountBridge` (`.read` / `.listen(activeAccountProvider)`) | Move each `ActiveAccountReader` to `ref.watch(activeAccountProvider)`, then delete the bridge |
|
||||
| `DelegationBindings` | Container handed to `RiverpodActiveAccountSource` (`.read` / `.listen(activeAccountProvider)`) | Move each `ActiveAccountReader` to `ref.watch(activeAccountProvider)`, then delete `ActiveAccountSource` and `ActiveAccountWriter` |
|
||||
|
||||
Each migration will be covered by a dedicated ADR and eliminates one `appProviderContainer` call site. When all six are gone:
|
||||
Each migration will be covered by a dedicated ADR and eliminates one `appProviderContainer` call site. When all of them are gone:
|
||||
|
||||
1. Replace `UncontrolledProviderScope` with plain `ProviderScope` in `main.dart`
|
||||
2. Delete `appProviderContainer` from `app_provider_container.dart`
|
||||
|
||||
Reference in new issue
Block a user