| 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 'button_base.dart'; | 6 import 'button_base.dart'; |
| 7 import 'icon.dart'; | 7 import 'icon.dart'; |
| 8 import 'ink_well.dart'; | 8 import 'ink_well.dart'; |
| 9 | 9 |
| 10 class MenuItem extends ButtonBase { | 10 class MenuItem extends ButtonBase { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 static final Style _iconStyle = new Style(''' | 28 static final Style _iconStyle = new Style(''' |
| 29 padding: 0px 16px;''' | 29 padding: 0px 16px;''' |
| 30 ); | 30 ); |
| 31 | 31 |
| 32 static final Style _labelStyle = new Style(''' | 32 static final Style _labelStyle = new Style(''' |
| 33 padding: 0px 16px; | 33 padding: 0px 16px; |
| 34 flex: 1;''' | 34 flex: 1;''' |
| 35 ); | 35 ); |
| 36 | 36 |
| 37 List<Node> children; | 37 List<UINode> children; |
| 38 String icon; | 38 String icon; |
| 39 | 39 |
| 40 MenuItem({ Object key, this.icon, this.children }) : super(key: key); | 40 MenuItem({ Object key, this.icon, this.children }) : super(key: key); |
| 41 | 41 |
| 42 Node buildContent() { | 42 UINode buildContent() { |
| 43 return new StyleNode( | 43 return new StyleNode( |
| 44 new InkWell( | 44 new InkWell( |
| 45 children: [ | 45 children: [ |
| 46 new StyleNode( | 46 new StyleNode( |
| 47 new Icon( | 47 new Icon( |
| 48 size: 24, | 48 size: 24, |
| 49 type: "${icon}_grey600" | 49 type: "${icon}_grey600" |
| 50 ), | 50 ), |
| 51 _iconStyle | 51 _iconStyle |
| 52 ), | 52 ), |
| 53 new Container( | 53 new Container( |
| 54 style: _labelStyle, | 54 style: _labelStyle, |
| 55 children: children | 55 children: children |
| 56 ) | 56 ) |
| 57 ] | 57 ] |
| 58 ), | 58 ), |
| 59 highlight ? _highlightStyle : _style | 59 highlight ? _highlightStyle : _style |
| 60 ); | 60 ); |
| 61 } | 61 } |
| 62 } | 62 } |
| OLD | NEW |