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