provider setState() or markNeedsBuild() called during build. code example
Example: setState() or markNeedsBuild() called during build.
WidgetsBinding.instance.addPostFrameCallback((_){
// Add Your Code here.
});
WidgetsBinding.instance.addPostFrameCallback((_){
// Add Your Code here.
});