Skip to content

feat: support controlFactory in both FormGroup and FormArray #477

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ahmednfwela
Copy link

@ahmednfwela ahmednfwela commented Mar 3, 2025

Connection with issue(s)

Close #366
Connected to artflutter/reactive_forms_generator#154

Solution description

This adds a new optional controlFactory parameter to both FormGroup and FormArray.

its only responsibility is creating new controls when calling updateValue

for a usage example see the test

To Do

  • 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

@ahmednfwela
Copy link
Author

The changes are 100% backwards compatible, but if the maintainers want, I can set more sensible defaults for defaultControlFactory to create a FormGroup if the value is a Map<String, Object?>, which will simplify the usage a lot as this is a common use case

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.

Implementation error while dealing with set value for a FormArray of FormGroups
1 participant