-
-
Notifications
You must be signed in to change notification settings - Fork 81
setState() or markNeedsBuild() called during build. #9
Comments
Is this error coming after merging with your code? |
Hi, Please close this issue. It's working perfectly working. |
Hi guys, `══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════ When the exception was thrown, this was the stack: |
When I get app then it show error.
======== Exception caught by foundation library ====================================================
The following assertion was thrown while dispatching notifications for FeedProvider:
setState() or markNeedsBuild() called during build.
This _DefaultInheritedProviderScope 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.
The widget on which setState() or markNeedsBuild() was called was: _DefaultInheritedProviderScope
value: Instance of 'FeedProvider'
listening to value
The widget which was currently being built when the offending call was made was: BlocBuilder<NewsFeedBloc, NewsFeedState>
dirty
state: _BlocBuilderBaseState<NewsFeedBloc, NewsFeedState>#b5032
When the exception was thrown, this was the stack:
#0 Element.markNeedsBuild. (package:flutter/src/widgets/framework.dart:4328:11)
#1 Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:4343:6)
#2 _InheritedProviderScopeMixin.markNeedsNotifyDependents (package:provider/src/inherited_provider.dart:269:5)
#3 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:243:25)
#4 FeedProvider.setDataLoaded (package:inshort_clone/controller/provider.dart:68:5)
...
The FeedProvider sending notification was: Instance of 'FeedProvider'
The text was updated successfully, but these errors were encountered: