Added AdvancedValidationStatusBuilder#48
Open
aydinguven-leancode wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new public builder widget to the leancode_forms package that rebuilds UI based on overall form validation status (including subforms), along with widget tests and an example screen demonstrating submit-button enable/disable behavior.
Changes:
- Introduces
AdvancedValidationStatusBuilderthat listens toAdvancedFormController.onStatusChangedand computes a form-levelisValid. - Adds widget tests verifying rebuild behavior, subform inclusion, and
childforwarding optimization. - Extends the example app with a new “Validation Status” screen and route.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/validators/builder/advanced_validation_status_builder.dart | Adds the new AdvancedValidationStatusBuilder widget. |
| lib/leancode_forms.dart | Exports the new builder from the package public API. |
| test/src/form/form_status_builder_test.dart | Adds widget tests for rebuild behavior and subform validity aggregation. |
| example/lib/screens/validation_status_form.dart | Adds an example screen demonstrating validity-driven submit enablement. |
| example/lib/screens/home_page.dart | Adds a navigation button to the new example screen. |
| example/lib/main.dart | Registers the new route and imports the new example screen. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+31
to
+40
| return ListenableBuilder( | ||
| /// Listen to the form's validation status and rebuild whenever it changes. | ||
| listenable: form.onStatusChanged, | ||
| child: child, | ||
| builder: (context, child) => builder( | ||
| context, | ||
| form.value.allFields.every((field) => field.value.isValid), | ||
| child, | ||
| ), | ||
| ); |
Comment on lines
+26
to
+27
| /// Forwarded to [ListenableBuilder.child], to support further optimizations | ||
| final Widget? child; |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes [LMG-398]
Closes issue #28
Added AdvancedValidationStatusBuilder + tests + new example screen