Closed JesusHdez960717 closed 1 year ago
Hey @JesusHdez960717 Thanks for asking.
You can specify your initial value or changing state value by using controller.
final dataCtrl = TextEditingController(text: data)
Now, that data
variable for controller text can hold your initial value or also the updated state[data] value. So in your case, when your model is ready for view, you can assign the value to controller so that dropdown knows something is passed as initial value.
I hope I answered your question, Thanks!
Thanks @AbdullahChauhan, your solution work perfectly. An amazing package, great work. 👍🏻
I have an implementation of this package as:
It work perfect, but... How can I specify the selected item, for example, when editing some model, I start the view with every field fill with the current value, how do I put the value corresponding to this dropdown. Or if I have one dropdown that depend on other, B depend on A, when I select a item in A, B is updated with the info, and I update the view, but if I update the view A loose the selected item.
In defaults dropdown, there is a property 'value' with this function, what is the equivalent of this property in this package?
This is the one how worked for my: