mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Merge pull request #1679 from abarth/fix_analyzer
Fix analyzer warnings in examples
This commit is contained in:
commit
6fe9446f01
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user