diff --git a/examples/rendering/flex.dart b/examples/rendering/flex.dart index 164220c4df8..30545b2267e 100644 --- a/examples/rendering/flex.dart +++ b/examples/rendering/flex.dart @@ -18,7 +18,8 @@ RenderBox buildFlexExample() { void addFlexChildSolidColor(RenderFlex parent, ui.Color backgroundColor, { int flex: 0 }) { RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor); parent.add(child); - child.parentData.flex = flex; + final FlexParentData childParentData = child.parentData; + childParentData.flex = flex; } // Yellow bar at top diff --git a/examples/rendering/interactive_flex.dart b/examples/rendering/interactive_flex.dart index ce50fd92046..86494790a7c 100644 --- a/examples/rendering/interactive_flex.dart +++ b/examples/rendering/interactive_flex.dart @@ -49,7 +49,8 @@ void main() { void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex: 0 }) { RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor); parent.add(child); - child.parentData.flex = flex; + final FlexParentData childParentData = child.parentData; + childParentData.flex = flex; } var row = new RenderFlex(direction: FlexDirection.horizontal); @@ -90,7 +91,8 @@ Pancetta meatball tongue tenderloin rump tail jowl boudin."""; addFlexChildSolidColor(column, const Color(0xFF0081C6), flex: 2); row.add(column); - column.parentData.flex = 8; + final FlexParentData childParentData = column.parentData; + childParentData.flex = 8; RenderDecoratedBox root = new RenderDecoratedBox( decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)), diff --git a/examples/rendering/render_paragraph.dart b/examples/rendering/render_paragraph.dart index 83a9bb04138..40207ebb352 100644 --- a/examples/rendering/render_paragraph.dart +++ b/examples/rendering/render_paragraph.dart @@ -16,7 +16,8 @@ void main() { RenderObject child = new RenderSolidColorBox(const Color(0xFFFFFF00)); flexRoot.add(child); - child.parentData.flex = 2; + FlexParentData childParentData = child.parentData; + childParentData.flex = 2; // The internet is a beautiful place. https://baconipsum.com/ String meatyString = """Bacon ipsum dolor amet ham fatback tri-tip, prosciutto @@ -33,7 +34,8 @@ Pancetta meatball tongue tenderloin rump tail jowl boudin."""; child: new RenderParagraph(text) ); flexRoot.add(child); - child.parentData.flex = 1; + childParentData = child.parentData; + childParentData.flex = 1; new FlutterBinding(root: root); } diff --git a/examples/rendering/spinning_flex.dart b/examples/rendering/spinning_flex.dart index c6d21ce168e..543b42e29c8 100644 --- a/examples/rendering/spinning_flex.dart +++ b/examples/rendering/spinning_flex.dart @@ -18,7 +18,8 @@ void main() { void addFlexChildSolidColor(RenderFlex parent, ui.Color backgroundColor, { int flex: 0 }) { RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor); parent.add(child); - child.parentData.flex = flex; + final FlexParentData childParentData = child.parentData; + childParentData.flex = flex; } addFlexChildSolidColor(flexRoot, const ui.Color(0xFFFF00FF), flex: 1);