Commit 8382ca2c authored by Adam Barth's avatar Adam Barth

Fix analyzer warnings in examples

parent 734240db
......@@ -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
......
......@@ -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)),
......
......@@ -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);
}
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment