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 '../theme/colors.dart'; | 6 import '../rendering/box.dart'; |
7 import '../theme/view_configuration.dart'; | 7 import '../rendering/flex.dart'; |
8 import '../theme2/colors.dart'; | |
9 import '../theme2/view_configuration.dart'; | |
10 import 'dart:sky' as sky; | |
8 | 11 |
9 class DrawerHeader extends Component { | 12 class DrawerHeader extends Component { |
10 static final Style _style = new Style(''' | |
11 height: ${140 + kStatusBarHeight}px; | |
12 background-color: ${BlueGrey[50]}; | |
13 border-bottom: 1px solid #D1D9E1; | |
14 padding-bottom: 7px; | |
15 margin-bottom: 8px;''' | |
16 ); | |
17 | |
18 static final FlexBoxParentData _spacerParentData = new FlexBoxParentData()..fl ex = 1; | |
19 | |
20 static final Style _labelStyle = new Style(''' | |
21 padding: 0 16px;''' | |
22 ); | |
23 | 13 |
24 List<UINode> children; | 14 List<UINode> children; |
25 | 15 |
26 DrawerHeader({ Object key, this.children }) : super(key: key); | 16 DrawerHeader({ Object key, this.children }) : super(key: key); |
27 | 17 |
28 UINode build() { | 18 UINode build() { |
29 return new FlexContainer( | 19 return new Container( |
30 direction: FlexDirection.vertical, | 20 key: 'drawer-header-outside', |
31 style: _style, | 21 desiredSize: const sky.Size.fromHeight(kStatusBarHeight + kMaterialDrawerH eight), |
32 children: [ | 22 decoration: new BoxDecoration( |
33 new ParentDataNode( | 23 backgroundColor: BlueGrey[50], |
34 new Container(key: 'Spacer'), | 24 border: const Border( |
35 _spacerParentData | 25 bottom: const BorderSide( |
36 ), | 26 color: const sky.Color(0xFFD1D9E1), |
eseidel
2015/06/08 17:55:20
sky.
| |
37 new Container( | 27 width: 1.0 |
38 key: 'Label', | 28 ) |
39 style: _labelStyle, | |
40 children: children | |
41 ) | 29 ) |
42 ] | 30 ), |
31 padding: const EdgeDims.only(bottom: 7.0), | |
32 margin: const EdgeDims.only(bottom: 8.0), | |
33 child: new FlexContainer( | |
34 key: 'drawer-header-inside', | |
35 direction: FlexDirection.vertical, | |
36 children: [ | |
37 new FlexExpandingChild(new Container( | |
38 key: 'drawer-header-spacer', | |
39 desiredSize: sky.Size.infinite | |
eseidel
2015/06/08 17:55:21
sky.
| |
40 )), | |
41 new Container( | |
42 key: 'drawer-header-label', | |
43 padding: const EdgeDims.symmetric(horizontal: 16.0), | |
44 child: new FlexContainer( | |
45 direction: FlexDirection.horizontal, | |
46 children: children | |
47 ) | |
48 ) | |
49 ] | |
50 ) | |
43 ); | 51 ); |
44 } | 52 } |
45 } | 53 } |
OLD | NEW |