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