diff --git a/CHANGELOG.md b/CHANGELOG.md index fe8129d9..a9c97711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ -## Unreleased +## 0.3.0 -* Validation modes are now yours to write. `ValidationMode` is a class, and `ValidationMode.custom(name, fn)` turns a one-line rule into a mode the package treats like its own. +Validation modes are now yours to write. The four modes stay as they were; what is new is that a rule none of them states no longer needs a workaround. + +* `ValidationMode` is a class, and `ValidationMode.custom(name, fn)` turns a one-line rule into a mode the package treats like its own. * The rule gets a `ValidationContext`: which event is happening (`valueChanged`, `unfocus` or `dependencyChanged`) and whether the user has ever left the field after editing it. * It never sees the status, the errors or the value, so a rule cannot switch itself off while the user is fixing a mistake. * An untouched field still validates nothing, whatever the rule says; `validate()` still ignores the mode; sync still runs before async. @@ -8,8 +10,16 @@ * Modes are compared by name, so a mode built in `build()` is not a mode change; a built-in name throws. * 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. +* The mode pickers in the docs demos are pills that wrap, so every mode name is readable on a phone. + +Breaking changes, both small: + +* An exhaustive `switch` over `ValidationMode` needs a default case now. +* `ValidationMode.values` is gone, because with custom modes there is no finite list. + +Still here: + +* 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, and that is enough. ## 0.2.4 diff --git a/example/pubspec.lock b/example/pubspec.lock index 804346c8..1c63da7e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -15,7 +15,7 @@ packages: path: ".." relative: true source: path - version: "0.2.4" + version: "0.3.0" analyzer: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b7451697..0a029780 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,7 +1,7 @@ name: advanced_forms_example description: Gallery app for advanced_forms — one screen per documented form pattern. publish_to: "none" -version: 0.2.4 +version: 0.3.0 environment: sdk: ">=3.3.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1c92f6c6..96b7ef0f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: advanced_forms description: Flutter form validation and state management — typed controllers for text, checkbox, dropdown and multi-select fields, async and cross-field validators, and subforms. -version: 0.2.4 +version: 0.3.0 homepage: https://github.com/leancodepl/advanced_forms repository: https://github.com/leancodepl/advanced_forms issue_tracker: https://github.com/leancodepl/advanced_forms/issues