From 2efbd3ebc8f84f0d102a7728a19cf28d5da150f9 Mon Sep 17 00:00:00 2001 From: Kamil Sztandur Date: Sat, 24 Oct 2026 15:34:36 +0200 Subject: [PATCH] The deprecated stream extension stays until 0.4.0 It was announced for removal in 0.3.0. That release already asks users for one change (a default case in a switch over ValidationMode), so the bridge for 0.1.x cubit streams gets one more minor version. The deprecation message, the migration guide and the FAQ say 0.4.0 now. Co-Authored-By: Claude Fable 5.1 --- CHANGELOG.md | 1 + MIGRATION.md | 4 ++-- docs/faq.mdx | 2 +- docs/migration.mdx | 2 +- lib/src/field/advanced_field_controller_extensions.dart | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d06f72f4..fe8129d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * The docs have a page for it with a live demo, and the README and the skill cover it too. * New built-in mode `ValidationMode.afterFirstUnfocus`: quiet while the user types, validates when the field is first left, and from then on validates every edit, so an error disappears the moment the value is fixed. * Breaking: an exhaustive `switch` over `ValidationMode` needs a default case, and `ValidationMode.values` is gone, because with custom modes there is no finite list. +* The deprecated `stream` extension stays until 0.4.0; it was announced for removal in 0.3.0, but this release already asks for one change in a `switch`, and that is enough. ## 0.2.4 diff --git a/MIGRATION.md b/MIGRATION.md index a47d688e..7d149131 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -49,7 +49,7 @@ | `form.onValuesChangedStream` (`Stream`) | `form.onValuesChanged` (`Listenable`) | | `form.onStatusChangedStream` (`Stream`) | `form.onStatusChanged` (`Listenable`, no payload) | | `BlocBuilder` | `ValueListenableBuilder` — there is no `AdvancedFormBuilder` | -| `FieldCubit.stream` (inherited from `Cubit`) | `AdvancedFieldController.stream` — deprecated extension, removed in 0.3.0 ([section 9](#9-migrating-a-custom-field)) | +| `FieldCubit.stream` (inherited from `Cubit`) | `AdvancedFieldController.stream` — deprecated extension, removed in 0.4.0 ([section 9](#9-migrating-a-custom-field)) | | `Future close()` | `void dispose()` | | `addDisposable(...)`, the `Disposable` mixin | **Removed** — override `dispose()` ([section 7](#7-lifecycle-close--dispose)) | @@ -478,7 +478,7 @@ final subscription = quantityField.stream .listen(recalculateTotals); ``` -Three caveats: every read allocates a new `StreamController`, so store it rather than re-reading the getter; the controller is never closed, so unlike `Cubit.stream` it does not terminate an `await for` loop; and it goes away in 0.3.0. +Three caveats: every read allocates a new `StreamController`, so store it rather than re-reading the getter; the controller is never closed, so unlike `Cubit.stream` it does not terminate an `await for` loop; and it goes away in 0.4.0. --- diff --git a/docs/faq.mdx b/docs/faq.mdx index 51a422a7..ef993ae8 100644 --- a/docs/faq.mdx +++ b/docs/faq.mdx @@ -176,7 +176,7 @@ needs a fresh controller. Consider `setValidationEnabled(false)` instead of deta 0.1.x controllers were cubits, so they had a `stream`. 0.2 is `Listenable`-based: `addListener`, `subscribeToFields`, `onValuesChanged`, `onStatusChanged`, and the builder widgets. A deprecated -`AdvancedFieldController.stream` extension exists as a migration bridge and is removed in 0.3.0. See +`AdvancedFieldController.stream` extension exists as a migration bridge and is removed in 0.4.0. See [Migration](./migration.mdx). diff --git a/docs/migration.mdx b/docs/migration.mdx index 34c2fcbd..b01b5adb 100644 --- a/docs/migration.mdx +++ b/docs/migration.mdx @@ -93,7 +93,7 @@ until the user edits it; where it must, call `validate()` on it from a listener | `removeSubform(form, close: …)` | `removeSubform(form)` — detaches only, returns `void` | | `Future close()`, `addDisposable`, `Disposable` | `void dispose()` | | `BlocBuilder` | `ValueListenableBuilder` | -| `FieldCubit.stream` | `AdvancedFieldController.stream` — deprecated bridge, removed in 0.3.0 | +| `FieldCubit.stream` | `AdvancedFieldController.stream` — deprecated bridge, removed in 0.4.0 | ## Behaviour changes that are not renames diff --git a/lib/src/field/advanced_field_controller_extensions.dart b/lib/src/field/advanced_field_controller_extensions.dart index d6b03d23..aff6717a 100644 --- a/lib/src/field/advanced_field_controller_extensions.dart +++ b/lib/src/field/advanced_field_controller_extensions.dart @@ -24,7 +24,7 @@ extension AdvancedFieldControllerListen /// Listeners are attached lazily on first subscription and detached when /// the last subscription is cancelled. @Deprecated( - 'Migration bridge for 0.1.x cubit streams, to be removed in 0.3.0. ' + 'Migration bridge for 0.1.x cubit streams, to be removed in 0.4.0. ' 'Use addListener, subscribeToFields, or the builder widgets instead.', ) Stream> get stream {