#flutter #initState #tips
The error you're encountering is caused by trying to update the UI (noteModel.content = '#${noteModel.initialTag}\n';) within the initState method, which triggers a rebuild of the widget while it is still in the build phase. This is not allowed in Flutter, as it can lead to inconsistent states.

To resolve this issue, you should delay the update until after the build phase. You can achieve this by using WidgetsBinding.instance.addPostFrameCallback, which schedules the code to run after the current frame has been rendered.
 
 
Back to Top