@@ -16,39 +16,34 @@ import 'solid_color_box.dart';
1616void main () {
1717 var table = new RenderFlex (direction: FlexDirection .vertical);
1818
19- void addRow (FlexAlignItems align ) {
19+ for (FlexAlignItems alignItems in FlexAlignItems .values ) {
2020 TextStyle style = const TextStyle (color: const Color (0xFF000000 ));
21- RenderParagraph paragraph = new RenderParagraph (new InlineStyle (style, [new InlineText ("${align }" )]));
21+ RenderParagraph paragraph = new RenderParagraph (new InlineStyle (style, [new InlineText ("${alignItems }" )]));
2222 table.add (new RenderPadding (child: paragraph, padding: new EdgeDims .only (top: 20.0 )));
23- var row = new RenderFlex (direction : FlexDirection .horizontal );
23+ var row = new RenderFlex (alignItems : alignItems );
2424
2525 style = new TextStyle (fontSize: 15.0 , color: const Color (0xFF000000 ));
2626 row.add (new RenderDecoratedBox (
27- decoration: new BoxDecoration (backgroundColor: const Color (0xFFFFCCCC )),
27+ decoration: new BoxDecoration (backgroundColor: const Color (0x7FFFCCCC )),
2828 child: new RenderParagraph (new InlineStyle (style, [new InlineText ('foo foo foo' )]))
2929 ));
3030 style = new TextStyle (fontSize: 10.0 , color: const Color (0xFF000000 ));
3131 row.add (new RenderDecoratedBox (
32- decoration: new BoxDecoration (backgroundColor: const Color (0xFFCCFFCC )),
32+ decoration: new BoxDecoration (backgroundColor: const Color (0x7FCCFFCC )),
3333 child: new RenderParagraph (new InlineStyle (style, [new InlineText ('foo foo foo' )]))
3434 ));
35+ var subrow = new RenderFlex (alignItems: alignItems);
3536 style = new TextStyle (fontSize: 25.0 , color: const Color (0xFF000000 ));
36- row .add (new RenderDecoratedBox (
37- decoration: new BoxDecoration (backgroundColor: const Color (0xFFCCCCFF )),
37+ subrow .add (new RenderDecoratedBox (
38+ decoration: new BoxDecoration (backgroundColor: const Color (0x7FCCCCFF )),
3839 child: new RenderParagraph (new InlineStyle (style, [new InlineText ('foo foo foo foo' )]))
3940 ));
40- row .add (new RenderSolidColorBox (const Color (0xFFCCFFFF ), desiredSize: new Size (30.0 , 40.0 )));
41- row.alignItems = align ;
41+ subrow .add (new RenderSolidColorBox (const Color (0x7FCCFFFF ), desiredSize: new Size (30.0 , 40.0 )));
42+ row.add (subrow) ;
4243 table.add (row);
4344 row.parentData.flex = 1 ;
4445 }
4546
46- addRow (FlexAlignItems .start);
47- addRow (FlexAlignItems .end);
48- addRow (FlexAlignItems .center);
49- addRow (FlexAlignItems .stretch);
50- addRow (FlexAlignItems .baseline);
51-
5247 RenderDecoratedBox root = new RenderDecoratedBox (
5348 decoration: new BoxDecoration (backgroundColor: const Color (0xFFFFFFFF )),
5449 child: new RenderPadding (child: table, padding: new EdgeDims .symmetric (vertical: 50.0 ))
0 commit comments