flutter_form_builder
                                
                                 flutter_form_builder copied to clipboard
                                
                                    flutter_form_builder copied to clipboard
                            
                            
                            
                        Form Value Builder Widget To Update UI
A workaround is to have the form builder inside a stateful widget but a builder widget would be more convenient
FormBuilder(
  key: form,
  initialValue: {'dp': <SOME_VALUE>},
  child: Column(
    children: [
      FormBuilderValue(
        builder: (form_value) => <SOME_WIDGET>
      ),
      DPSelector(name: 'dp')
    ]
  )
)
Current use case that I have is -
- I have a profile picture selector as part of the form
- I want to display the currently selected picture next to the username
For now I am using a stateful widget to handle this.
I'd be happy to work on a pull request for this if it seems fruitful.
Sorry, but I could not understand. Are you trying to show/hide fields dynamically?
In such case, registerField and removeInternalFieldValue from formKey currentState does not satisfy your situation?
@WilliamCunhaCardoso Is there an example or any documentation for what you're referring? (am trying to show/hide fields dynamically) It would be helpful for any first timers like me. Appreciate and thanks in advance.
@WilliamCunhaCardoso Is there an example or any documentation for what you're referring? (am trying to show/hide fields dynamically) It would be helpful for any first timers like me. Appreciate and thanks in advance.
Unfortunately, no :(
But I wish to do one. Actually, I am with limited time due to my job, so, till now I could not be able to give such help.
Actually, here in my project I am showing and hiding fields with Visibility()
@BLaZeKiLL I don't understand your question. What do you need? Show a form field value in another widget?
This is similar too 2 way binding in angular,
Suppose I have a text input field and a plain old text widget. I would like to have the value from the text field be reflected in the text widget without needing to submit the form
So if we have a builder widget that returns the forms current value we can have a text widget in side the builder reading the form value and displaying it.
Anytime the text input field is updated the builder widget would rebuild with the updated value
@BLaZeKiLL  Ok, maybe with formKey.currentState.instantValues['fieldName'].value can be access to instant value of field and used in widget that you want
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.