Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add itemDecoration to checkbox groups nad radio groups to add borders to checkboxes and radio buttons #1344

Conversation

freemansoft
Copy link
Contributor

@freemansoft freemansoft commented Dec 24, 2023

Connection with issue(s)

Close #1343

Connected to #???

Solution description

This change adds a BoxDecoration property called itemDecorator to FormBuilderCheckboxGroup and FormBiulderRadioGroup that is passed to every item they build. This lets you add borders to checkbox items and radio buttons.

  1. Inter-control spacing is still set via the wrapSpacing property.
  2. Intra-control margins on the side opposite the control (radio or checkbox) need to be set if the label is text only and a box is applied. There is no parameter for this. I looked at using wrapSpacing but that was a hack. The work around is to add trailing spaces to the label text :-(

Screenshots or Videos

This screenshot shows the changes to the example program. I deliberately showed the default behavior for text when a border is applied.

flutter-form-builder-inputDecoration-8

flutter-form-builder-inputDecoration-7

To Do

  • Read contributing guide
  • Check the original issue to confirm it is fully satisfied
  • Add solution description to help guide reviewers
  • Add unit test to verify new or fixed behaviour
  • If apply, add documentation to code properties and package readme

@freemansoft
Copy link
Contributor Author

Pushed change that removed unused dart:ui import

Copy link

codecov bot commented Dec 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e518c0e) 85.14% compared to head (dde086c) 87.03%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1344      +/-   ##
==========================================
+ Coverage   85.14%   87.03%   +1.88%     
==========================================
  Files          21       21              
  Lines         734      748      +14     
==========================================
+ Hits          625      651      +26     
+ Misses        109       97      -12     

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

@deandreamatias deandreamatias merged commit 66d87f0 into flutter-form-builder-ecosystem:main Dec 28, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants