file_manager icon indicating copy to clipboard operation
file_manager copied to clipboard

ValueListenableBuilder<String> widget cannot be marked as needing to build.

Open dasaki-gr opened this issue 3 years ago • 0 comments

When I try to run the example code given, I get the below error. I'm not familiar with ValueNotifier and ValueListenableBuilder so I can't figure out, what seems to be the issue here.

The following assertion was thrown while dispatching notifications for ValueNotifier<String>: setState() or markNeedsBuild() called during build.

This ValueListenableBuilder<String> widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.

I have found same issue in :https://stackoverflow.com/questions/71191775/valuelistenablebuilderstring-widget-cannot-be-marked-as-needing-to-build-sets

dasaki-gr avatar Nov 14 '22 06:11 dasaki-gr