I need to disable TextFormField occasionally. I couldn\'t find a flag in the widget, or the controller to simply make it read only or disable. What is the best way to do it?
Use readOnly:true is correct. But if you still want focus to this text field you can follow below code:
readOnly:true
TextFormField( showCursor: true,//add this line readOnly: true )