After building the app ios app using flutter and running it on a device, the flutter code gave an exception on visual studio IDE sometimes and crashed. The exception looks like -
Can anyone help why is this happening or provide a possible solution to this ?
Call your code that calls setState with some delay like the following example.
Future.delayed(Duration.zero, () async {
setState(() {
myController.text = widget.valueText ?? '';
});
});