I have the following component on my flutter page.
TextFormField(
controller: surveyDateController,
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'Survey Date',
),
),
And i have the following controller for the above control
final surveyDateController = TextEditingController();
The data is coming from _data.leadSurvey[0].title which is loaded from an API. Once the data is loaded I am calling the setState method as follows:
setState(() {
_data = data;
});
But the data in the TextFormField is not getting updated. Tried using the initialValue property but it generates a null error.
Any help guys?