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 '../theme/colors.dart'; | 6 import '../theme/colors.dart'; |
7 import '../theme/view-configuration.dart'; | 7 import '../theme/view-configuration.dart'; |
8 | 8 |
9 class DrawerHeader extends Component { | 9 class DrawerHeader extends Component { |
10 static final Style _style = new Style(''' | 10 static final Style _style = new Style(''' |
11 display: flex; | 11 display: flex; |
12 flex-direction: column; | 12 flex-direction: column; |
13 height: ${140 + kStatusBarHeight}px; | 13 height: ${140 + kStatusBarHeight}px; |
14 -webkit-user-select: none; | 14 -webkit-user-select: none; |
15 background-color: ${BlueGrey[50]}; | 15 background-color: ${BlueGrey[50]}; |
16 border-bottom: 1px solid #D1D9E1; | 16 border-bottom: 1px solid #D1D9E1; |
17 padding-bottom: 7px; | 17 padding-bottom: 7px; |
18 margin-bottom: 8px;''' | 18 margin-bottom: 8px;''' |
19 ); | 19 ); |
20 | 20 |
21 static final Style _spacerStyle = new Style(''' | 21 static final Style _spacerStyle = new Style(''' |
22 flex: 1''' | 22 flex: 1''' |
23 ); | 23 ); |
24 | 24 |
25 static final Style _labelStyle = new Style(''' | 25 static final Style _labelStyle = new Style(''' |
26 padding: 0 16px; | 26 padding: 0 16px;''' |
27 font-family: 'Roboto Medium', 'Helvetica'; | |
28 color: #212121;''' | |
29 ); | 27 ); |
30 | 28 |
31 List<Node> children; | 29 List<Node> children; |
32 | 30 |
33 DrawerHeader({ Object key, this.children }) : super(key: key); | 31 DrawerHeader({ Object key, this.children }) : super(key: key); |
34 | 32 |
35 Node build() { | 33 Node build() { |
36 return new Container( | 34 return new Container( |
37 style: _style, | 35 style: _style, |
38 children: [ | 36 children: [ |
39 new Container( | 37 new Container( |
40 key: 'Spacer', | 38 key: 'Spacer', |
41 style: _spacerStyle | 39 style: _spacerStyle |
42 ), | 40 ), |
43 new Container( | 41 new Container( |
44 key: 'Label', | 42 key: 'Label', |
45 style: _labelStyle, | 43 style: _labelStyle, |
46 children: children | 44 children: children |
47 ) | 45 ) |
48 ] | 46 ] |
49 ); | 47 ); |
50 } | 48 } |
51 } | 49 } |
OLD | NEW |