set method
Use this function to set a text field value using the unique id you supplied earlier!
{@tool snippet}
onPressed: () {
//* Set controller value
_formController.set("id1", "The new field value!")
}
{@end-tool}
Implementation
void set(String id, String text) {
if (_textControllers.containsKey(id) && _textControllers[id] != null) {
_textControllers[id]!.text = text;
} else {
throw Exception(
"No controllers found with the provided id, Did you create a controller with this id? Did you wait for the controller to initializ?");
}
}