'$description has a $T ancestor, but there are other widgets between them:\n';
for(WidgetancestorinbadAncestors){
if(ancestor.runtimeType==runtimeType){
result+='$ancestor (this is a different $runtimeType than the one with the problem)\n';
result+='-$ancestor (this is a different $runtimeType than the one with the problem)\n';
}else{
result+='$ancestor\n';
result+='-$ancestor\n';
}
}
result+='These widgets cannot come between a $runtimeType and its $T.\n';
...
...
@@ -1356,6 +1410,15 @@ class _InactiveElements {
_elements.remove(element);
assert(!element._active);
}
booldebugContains(Elementelement){
boolresult;
assert((){
result=_elements.contains(element);
returntrue;
});
returnresult;
}
}
/// Signature for the callback to [BuildContext.visitChildElements].
...
...
@@ -1669,9 +1732,9 @@ class BuildOwner {
debugPrintStack(label:'markNeedsToResortDirtyElements() called; _dirtyElementsNeedsResorting was $_dirtyElementsNeedsResorting (now true); dirty list is: $_dirtyElements');
if(_dirtyElementsNeedsResorting==null){
thrownewFlutterError(
'markNeedsToResortDirtyElements() called inappropriately.\n'
'The markNeedsToResortDirtyElements() method should only be called while the '
'buildScope() method is actively rebuilding the widget tree.'
'markNeedsToResortDirtyElements() called inappropriately.\n'
'The markNeedsToResortDirtyElements() method should only be called while the '
'buildScope() method is actively rebuilding the widget tree.'
expect(console.join('\n'),matches('Another exception was thrown: \'[^\']+packages/flutter/test/foundation/error_reporting_test\\.dart\': Failed assertion: line [0-9]+ pos [0-9]+: \'false\': is not true\\.'));
expect(error.toString(),startsWith('Duplicate GlobalKey detected in widget tree.\n'));
expect(error.toString(),contains('The following GlobalKey was specified multiple times'));
// The following line is verifying the grammar is correct in this common case.
// We should probably also verify the three other combinations that can be generated...
expect(error.toString(),contains('This was determined by noticing that after the widget with the above global key was moved out of its previous parent, that previous parent never updated during this frame, meaning that it either did not update at all or updated before the widget was moved, in either case implying that it still thinks that it should have a child with that global key.'));