Skip to content

fix: forward the field error state to the checkbox in FormBuilderCheckbox #1503 - #1515

Open
Yusufihsangorgel wants to merge 2 commits into
flutter-form-builder-ecosystem:mainfrom
Yusufihsangorgel:fix/checkbox-error-state
Open

fix: forward the field error state to the checkbox in FormBuilderCheckbox #1503#1515
Yusufihsangorgel wants to merge 2 commits into
flutter-form-builder-ecosystem:mainfrom
Yusufihsangorgel:fix/checkbox-error-state

Conversation

@Yusufihsangorgel

Copy link
Copy Markdown
Contributor

Closes #1503

FormBuilderCheckbox never told the checkbox about the field's error state, so WidgetStateBorderSide.resolveWith / fillColor resolving WidgetState.error had no effect, as reported in the issue.

The builder now passes isError: state.hasError to the internal CheckboxListTile, which is the Material way to put the checkbox itself into the error state, so any side, fillColor or checkbox theme that resolves WidgetState.error starts working without new API surface.

Added a widget test: the checkbox reports isError after a failed validate and drops it once the value is valid again. flutter test and flutter analyze are clean.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.36%. Comparing base (f8706f7) to head (8adcbce).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1515   +/-   ##
=======================================
  Coverage   92.35%   92.36%           
=======================================
  Files          21       21           
  Lines         863      864    +1     
=======================================
+ Hits          797      798    +1     
  Misses         66       66           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Yusufihsangorgel Yusufihsangorgel changed the title fix: forward the field error state to the checkbox in FormBuilderCheckbox fix: forward the field error state to the checkbox in FormBuilderCheckbox #1503 Jul 20, 2026
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.

[FormBuilderCheckbox]: Support error styling

2 participants