Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The error "setState() or markNeedsBuild() called during build" in a provider class means that the state of the widget is being changed during the build process, which is not allowed in Flutter. This error typically occurs when there is a change to the data model triggering a state change, but the widget is already in the process of being built. To resolve this error, it's important to ensure that any state changes are made before or after the build process. One way to achieve this is by using a Future or a FutureBuilder to make the state changes once the build process is complete.