When i use this code it works correctly, the controller.text is updated.
textController.addListener(() {
setState(() {
textController.text = analyzeText;
});
});
But when i try to add end of text, it crash does not give error. Why?
textController.addListener(() {
setState(() {
textController.text += ' ' + analyzeText;
});
});
It seems to me that you are creating a never ending loop, possibly creating a memory leak of sorts. You have a listener listening for changes in a controller, and inside that listener you are making a change to that very same controller. So once it starts, it never stops. That is very likely to cause a crash.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments