OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import 'dart:math' as math; | 5 import 'dart:math' as math; |
6 | 6 |
7 import 'package:sky/rendering/box.dart'; | 7 import 'package:sky/rendering/box.dart'; |
8 import 'package:sky/rendering/flex.dart'; | 8 import 'package:sky/rendering/flex.dart'; |
9 import 'package:sky/theme2/colors.dart'; | 9 import 'package:sky/theme2/colors.dart'; |
10 import 'package:sky/theme2/edges.dart'; | 10 import 'package:sky/theme2/edges.dart'; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 toolbar: new ToolBar( | 77 toolbar: new ToolBar( |
78 center: new Text('Sector Layout in a Widget Tree', style: white.title)
, | 78 center: new Text('Sector Layout in a Widget Tree', style: white.title)
, |
79 backgroundColor: Blue[500]), | 79 backgroundColor: Blue[500]), |
80 body: new Material( | 80 body: new Material( |
81 edge: MaterialEdge.canvas, | 81 edge: MaterialEdge.canvas, |
82 child: new Flex([ | 82 child: new Flex([ |
83 new Container( | 83 new Container( |
84 padding: new EdgeDims.symmetric(horizontal: 8.0, vertical: 25.0), | 84 padding: new EdgeDims.symmetric(horizontal: 8.0, vertical: 25.0), |
85 child: new Flex([ | 85 child: new Flex([ |
86 new RaisedButton( | 86 new RaisedButton( |
87 key: 'add-button', | |
88 enabled: enabledAdd, | 87 enabled: enabledAdd, |
89 child: new ShrinkWrapWidth( | 88 child: new ShrinkWrapWidth( |
90 child: new Flex([ | 89 child: new Flex([ |
91 new Container( | 90 new Container( |
92 padding: new EdgeDims.all(4.0), | 91 padding: new EdgeDims.all(4.0), |
93 margin: new EdgeDims.only(right: 10.0), | 92 margin: new EdgeDims.only(right: 10.0), |
94 child: new WidgetToRenderBoxAdapter(sectorAddIcon) | 93 child: new WidgetToRenderBoxAdapter(sectorAddIcon) |
95 ), | 94 ), |
96 new Text('ADD SECTOR'), | 95 new Text('ADD SECTOR'), |
97 ]) | 96 ]) |
98 ), | 97 ), |
99 onPressed: addSector | 98 onPressed: addSector |
100 ), | 99 ), |
101 new RaisedButton( | 100 new RaisedButton( |
102 key: 'remove-button', | |
103 enabled: enabledRemove, | 101 enabled: enabledRemove, |
104 child: new ShrinkWrapWidth( | 102 child: new ShrinkWrapWidth( |
105 child: new Flex([ | 103 child: new Flex([ |
106 new Container( | 104 new Container( |
107 padding: new EdgeDims.all(4.0), | 105 padding: new EdgeDims.all(4.0), |
108 margin: new EdgeDims.only(right: 10.0), | 106 margin: new EdgeDims.only(right: 10.0), |
109 child: new WidgetToRenderBoxAdapter(sectorRemoveIcon) | 107 child: new WidgetToRenderBoxAdapter(sectorRemoveIcon) |
110 ), | 108 ), |
111 new Text('REMOVE SECTOR'), | 109 new Text('REMOVE SECTOR'), |
112 ]) | 110 ]) |
(...skipping 23 matching lines...) Expand all Loading... |
136 } | 134 } |
137 } | 135 } |
138 | 136 |
139 void main() { | 137 void main() { |
140 runApp(new SectorApp()); | 138 runApp(new SectorApp()); |
141 WidgetAppView.appView.onFrame = () { | 139 WidgetAppView.appView.onFrame = () { |
142 // uncomment this for debugging: | 140 // uncomment this for debugging: |
143 // WidgetAppView.appView.debugDumpRenderTree(); | 141 // WidgetAppView.appView.debugDumpRenderTree(); |
144 }; | 142 }; |
145 } | 143 } |
OLD | NEW |