@@ -1194,7 +1194,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
1194
1194
// displaying the truncated children is really useful for command line
1195
1195
// users. Inspector users can see the full tree by clicking on the
1196
1196
// render object so this may not be that useful.
1197
- yield describeForError ('This RenderObject' , style: DiagnosticsTreeStyle .truncateChildren);
1197
+ yield describeForError ('RenderObject' , style: DiagnosticsTreeStyle .truncateChildren);
1198
1198
}
1199
1199
));
1200
1200
}
@@ -2030,14 +2030,17 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
2030
2030
void _paintWithContext (PaintingContext context, Offset offset) {
2031
2031
assert (() {
2032
2032
if (_debugDoingThisPaint) {
2033
- throw FlutterError (
2034
- 'Tried to paint a RenderObject reentrantly.\n '
2035
- 'The following RenderObject was already being painted when it was '
2036
- 'painted again:\n '
2037
- ' ${toStringShallow (joiner : "\n " )}\n '
2038
- 'Since this typically indicates an infinite recursion, it is '
2039
- 'disallowed.'
2040
- );
2033
+ throw FlutterError .fromParts (< DiagnosticsNode > [
2034
+ ErrorSummary ('Tried to paint a RenderObject reentrantly.' ),
2035
+ describeForError (
2036
+ 'The following RenderObject was already being painted when it was '
2037
+ 'painted again'
2038
+ ),
2039
+ ErrorDescription (
2040
+ 'Since this typically indicates an infinite recursion, it is '
2041
+ 'disallowed.'
2042
+ )
2043
+ ]);
2041
2044
}
2042
2045
return true ;
2043
2046
}());
@@ -2052,17 +2055,24 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
2052
2055
return ;
2053
2056
assert (() {
2054
2057
if (_needsCompositingBitsUpdate) {
2055
- throw FlutterError (
2056
- 'Tried to paint a RenderObject before its compositing bits were '
2057
- 'updated.\n '
2058
- 'The following RenderObject was marked as having dirty compositing '
2059
- 'bits at the time that it was painted:\n '
2060
- ' ${toStringShallow (joiner : "\n " )}\n '
2061
- 'A RenderObject that still has dirty compositing bits cannot be '
2062
- 'painted because this indicates that the tree has not yet been '
2063
- 'properly configured for creating the layer tree.\n '
2064
- 'This usually indicates an error in the Flutter framework itself.'
2065
- );
2058
+ throw FlutterError .fromParts (< DiagnosticsNode > [
2059
+ ErrorSummary (
2060
+ 'Tried to paint a RenderObject before its compositing bits were '
2061
+ 'updated.'
2062
+ ),
2063
+ describeForError (
2064
+ 'The following RenderObject was marked as having dirty compositing '
2065
+ 'bits at the time that it was painted' ,
2066
+ ),
2067
+ ErrorDescription (
2068
+ 'A RenderObject that still has dirty compositing bits cannot be '
2069
+ 'painted because this indicates that the tree has not yet been '
2070
+ 'properly configured for creating the layer tree.'
2071
+ ),
2072
+ ErrorHint (
2073
+ 'This usually indicates an error in the Flutter framework itself.'
2074
+ )
2075
+ ]);
2066
2076
}
2067
2077
return true ;
2068
2078
}());
@@ -2720,21 +2730,31 @@ mixin RenderObjectWithChildMixin<ChildType extends RenderObject> on RenderObject
2720
2730
bool debugValidateChild (RenderObject child) {
2721
2731
assert (() {
2722
2732
if (child is ! ChildType ) {
2723
- throw FlutterError (
2724
- 'A $runtimeType expected a child of type $ChildType but received a '
2725
- 'child of type ${child .runtimeType }.\n '
2726
- 'RenderObjects expect specific types of children because they '
2727
- 'coordinate with their children during layout and paint. For '
2728
- 'example, a RenderSliver cannot be the child of a RenderBox because '
2729
- 'a RenderSliver does not understand the RenderBox layout protocol.\n '
2730
- '\n '
2731
- 'The $runtimeType that expected a $ChildType child was created by:\n '
2732
- ' $debugCreator \n '
2733
- '\n '
2734
- 'The ${child .runtimeType } that did not match the expected child type '
2735
- 'was created by:\n '
2736
- ' ${child .debugCreator }\n '
2737
- );
2733
+ throw FlutterError .fromParts (< DiagnosticsNode > [
2734
+ ErrorSummary (
2735
+ 'A $runtimeType expected a child of type $ChildType but received a '
2736
+ 'child of type ${child .runtimeType }.'
2737
+ ),
2738
+ ErrorDescription (
2739
+ 'RenderObjects expect specific types of children because they '
2740
+ 'coordinate with their children during layout and paint. For '
2741
+ 'example, a RenderSliver cannot be the child of a RenderBox because '
2742
+ 'a RenderSliver does not understand the RenderBox layout protocol.' ,
2743
+ ),
2744
+ ErrorSpacer (),
2745
+ DiagnosticsProperty <dynamic >(
2746
+ 'The $runtimeType that expected a $ChildType child was created by' ,
2747
+ debugCreator,
2748
+ style: DiagnosticsTreeStyle .errorProperty,
2749
+ ),
2750
+ ErrorSpacer (),
2751
+ DiagnosticsProperty <dynamic >(
2752
+ 'The ${child .runtimeType } that did not match the expected child type '
2753
+ 'was created by' ,
2754
+ child.debugCreator,
2755
+ style: DiagnosticsTreeStyle .errorProperty,
2756
+ )
2757
+ ]);
2738
2758
}
2739
2759
return true ;
2740
2760
}());
@@ -2849,21 +2869,31 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
2849
2869
bool debugValidateChild (RenderObject child) {
2850
2870
assert (() {
2851
2871
if (child is ! ChildType ) {
2852
- throw FlutterError (
2853
- 'A $runtimeType expected a child of type $ChildType but received a '
2854
- 'child of type ${child .runtimeType }.\n '
2855
- 'RenderObjects expect specific types of children because they '
2856
- 'coordinate with their children during layout and paint. For '
2857
- 'example, a RenderSliver cannot be the child of a RenderBox because '
2858
- 'a RenderSliver does not understand the RenderBox layout protocol.\n '
2859
- '\n '
2860
- 'The $runtimeType that expected a $ChildType child was created by:\n '
2861
- ' $debugCreator \n '
2862
- '\n '
2863
- 'The ${child .runtimeType } that did not match the expected child type '
2864
- 'was created by:\n '
2865
- ' ${child .debugCreator }\n '
2866
- );
2872
+ throw FlutterError .fromParts (< DiagnosticsNode > [
2873
+ ErrorSummary (
2874
+ 'A $runtimeType expected a child of type $ChildType but received a '
2875
+ 'child of type ${child .runtimeType }.'
2876
+ ),
2877
+ ErrorDescription (
2878
+ 'RenderObjects expect specific types of children because they '
2879
+ 'coordinate with their children during layout and paint. For '
2880
+ 'example, a RenderSliver cannot be the child of a RenderBox because '
2881
+ 'a RenderSliver does not understand the RenderBox layout protocol.'
2882
+ ),
2883
+ ErrorSpacer (),
2884
+ DiagnosticsProperty <dynamic >(
2885
+ 'The $runtimeType that expected a $ChildType child was created by' ,
2886
+ debugCreator,
2887
+ style: DiagnosticsTreeStyle .errorProperty,
2888
+ ),
2889
+ ErrorSpacer (),
2890
+ DiagnosticsProperty <dynamic >(
2891
+ 'The ${child .runtimeType } that did not match the expected child type '
2892
+ 'was created by' ,
2893
+ child.debugCreator,
2894
+ style: DiagnosticsTreeStyle .errorProperty,
2895
+ ),
2896
+ ]);
2867
2897
}
2868
2898
return true ;
2869
2899
}());
0 commit comments