ErrorSummary('setState() or markNeedsBuild() called during build.'),
ErrorDescription(
'This ${widget.runtimeType} 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.',
),
describeElement('The widget on which setState() or markNeedsBuild() was called was'),
];
if(owner!._debugCurrentBuildTarget!=null){
information.add(owner!._debugCurrentBuildTarget!.describeWidget('The widget which was currently being built when the offending call was made was'));
}
assert(dirty);// can only get here if we're not in scope, but ignored calls are allowed, and our call would somehow be ignored (since we're already dirty)
throwFlutterError.fromParts(information);
}elseif(owner!._debugStateLocked){
assert(!_debugAllowIgnoredCallsToMarkNeedsBuild);
throwFlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('setState() or markNeedsBuild() called when widget tree was locked.'),
ErrorDescription(
...
...
@@ -4868,7 +4851,6 @@ abstract class ComponentElement extends Element {