Skip to content

Added AdvancedValidationStatusBuilder#48

Open
aydinguven-leancode wants to merge 2 commits into
refactor/cubit-to-notifier-migrationfrom
feature/LMG-398-validation-status-builder
Open

Added AdvancedValidationStatusBuilder#48
aydinguven-leancode wants to merge 2 commits into
refactor/cubit-to-notifier-migrationfrom
feature/LMG-398-validation-status-builder

Conversation

@aydinguven-leancode

@aydinguven-leancode aydinguven-leancode commented Jun 24, 2026

Copy link
Copy Markdown

Closes [LMG-398]
Closes issue #28

Added AdvancedValidationStatusBuilder + tests + new example screen

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AdvancedValidationStatusBuilder that listens to AdvancedFormController.onStatusChanged and computes a form-level isValid.
  • Adds widget tests verifying rebuild behavior, subform inclusion, and child forwarding 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 thread example/lib/screens/validation_status_form.dart Outdated
Comment thread example/lib/screens/validation_status_form.dart Outdated
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants