How to set form field from within custom code?

Custom Code

I can assign values to app variables and refresh the page or whole app state using this construct:

FFAppState().update(() {

FFAppState().var1= "value 1";

});

If the var1 is set as initial value for a Text control, it will update alright on the UI when it gets new value in custom action.

But if it is instead set as initial value for a TextField form control, it will not update when the var gets new value in custom code.

I need to explicitly call the SetFormField action from UI and pass the app variable as argument to make the GUI update.

How can I set the form field from custom code??

What have you tried so far?
Did you check FlutterFlow's Documentation for this topic?
Yes
1
2 replies