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 '../fn.dart'; | 5 import '../fn.dart'; |
6 import 'action_bar.dart'; | 6 import 'action_bar.dart'; |
7 import 'drawer.dart'; | 7 import 'drawer.dart'; |
8 import 'floating_action_button.dart'; | 8 import 'floating_action_button.dart'; |
9 import 'package:sky/framework/theme/typography.dart' as typography; | 9 import 'package:sky/framework/theme/typography.dart' as typography; |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 bottom: 16px; | 26 bottom: 16px; |
27 right: 16px;'''); | 27 right: 16px;'''); |
28 | 28 |
29 static final Style _drawerStyle = new Style(''' | 29 static final Style _drawerStyle = new Style(''' |
30 position: absolute; | 30 position: absolute; |
31 top: 0; | 31 top: 0; |
32 left: 0; | 32 left: 0; |
33 bottom: 0; | 33 bottom: 0; |
34 right: 0;'''); | 34 right: 0;'''); |
35 | 35 |
36 Node header; | 36 UINode header; |
37 Node content; | 37 UINode content; |
38 FloatingActionButton fab; | 38 FloatingActionButton fab; |
39 Drawer drawer; | 39 Drawer drawer; |
40 List<Node> overlays; | 40 List<UINode> overlays; |
41 | 41 |
42 Scaffold({ | 42 Scaffold({ |
43 Object key, | 43 Object key, |
44 this.header, | 44 this.header, |
45 this.content, | 45 this.content, |
46 this.fab, | 46 this.fab, |
47 this.drawer, | 47 this.drawer, |
48 this.overlays | 48 this.overlays |
49 }) : super(key: key); | 49 }) : super(key: key); |
50 | 50 |
51 Node build() { | 51 UINode build() { |
52 List<Node> children = [ | 52 List<UINode> children = [ |
53 new Container( | 53 new Container( |
54 key: 'Main', | 54 key: 'Main', |
55 style: _mainStyle, | 55 style: _mainStyle, |
56 children: [header, new StyleNode(content, _contentStyle)]) | 56 children: [header, new StyleNode(content, _contentStyle)]) |
57 ]; | 57 ]; |
58 | 58 |
59 if (fab != null) | 59 if (fab != null) |
60 children.add(new StyleNode(fab, _fabStyle)); | 60 children.add(new StyleNode(fab, _fabStyle)); |
61 | 61 |
62 if (drawer != null) | 62 if (drawer != null) |
63 children.add(new StyleNode(drawer, _drawerStyle)); | 63 children.add(new StyleNode(drawer, _drawerStyle)); |
64 | 64 |
65 if (overlays != null) | 65 if (overlays != null) |
66 children.addAll(overlays); | 66 children.addAll(overlays); |
67 | 67 |
68 return new Container(style: _style, children: children); | 68 return new Container(style: _style, children: children); |
69 } | 69 } |
70 } | 70 } |
OLD | NEW |