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 '../fn2.dart'; | 5 import '../fn2.dart'; |
6 import '../theme2/colors.dart'; | 6 import '../theme2/colors.dart'; |
7 import '../theme2/view_configuration.dart'; | 7 import '../theme2/view_configuration.dart'; |
8 | 8 |
9 class DrawerHeader extends Component { | 9 class DrawerHeader extends Component { |
10 | 10 |
11 List<UINode> children; | 11 List<UINode> children; |
12 | 12 |
13 DrawerHeader({ Object key, this.children }) : super(key: key); | 13 DrawerHeader({ Object key, this.children }) : super(key: key); |
14 | 14 |
15 UINode build() { | 15 UINode build() { |
16 return new Container( | 16 return new Container( |
17 key: 'drawer-header-outside', | 17 key: 'drawer-header-outside', |
18 desiredSize: const Size.fromHeight(kStatusBarHeight + kMaterialDrawerHeigh
t), | 18 height: kStatusBarHeight + kMaterialDrawerHeight, |
19 decoration: new BoxDecoration( | 19 decoration: new BoxDecoration( |
20 backgroundColor: BlueGrey[50], | 20 backgroundColor: BlueGrey[50], |
21 border: const Border( | 21 border: const Border( |
22 bottom: const BorderSide( | 22 bottom: const BorderSide( |
23 color: const Color(0xFFD1D9E1), | 23 color: const Color(0xFFD1D9E1), |
24 width: 1.0 | 24 width: 1.0 |
25 ) | 25 ) |
26 ) | 26 ) |
27 ), | 27 ), |
28 padding: const EdgeDims.only(bottom: 7.0), | 28 padding: const EdgeDims.only(bottom: 7.0), |
29 margin: const EdgeDims.only(bottom: 8.0), | 29 margin: const EdgeDims.only(bottom: 8.0), |
30 child: new FlexContainer( | 30 child: new FlexContainer( |
31 key: 'drawer-header-inside', | 31 key: 'drawer-header-inside', |
32 direction: FlexDirection.vertical, | 32 direction: FlexDirection.vertical, |
33 children: [ | 33 children: [ |
34 new FlexExpandingChild(new Container( | 34 new FlexExpandingChild(new Container(key: 'drawer-header-spacer')), |
35 key: 'drawer-header-spacer', | |
36 desiredSize: Size.infinite | |
37 )), | |
38 new Container( | 35 new Container( |
39 key: 'drawer-header-label', | 36 key: 'drawer-header-label', |
40 padding: const EdgeDims.symmetric(horizontal: 16.0), | 37 padding: const EdgeDims.symmetric(horizontal: 16.0), |
41 child: new FlexContainer( | 38 child: new FlexContainer( |
42 direction: FlexDirection.horizontal, | 39 direction: FlexDirection.horizontal, |
43 children: children | 40 children: children |
44 ) | 41 ) |
45 ) | 42 ) |
46 ] | 43 ] |
47 ) | 44 ) |
48 ); | 45 ); |
49 } | 46 } |
50 } | 47 } |
OLD | NEW |