| OLD | NEW |
| (Empty) |
| 1 part of widgets; | |
| 2 | |
| 3 class MenuItem extends ButtonBase { | |
| 4 | |
| 5 static Style _style = new Style(''' | |
| 6 transform: translateX(0); | |
| 7 display: flex; | |
| 8 align-items: center; | |
| 9 height: 48px; | |
| 10 -webkit-user-select: none;''' | |
| 11 ); | |
| 12 | |
| 13 static Style _highlightStyle = new Style(''' | |
| 14 transform: translateX(0); | |
| 15 display: flex; | |
| 16 align-items: center; | |
| 17 height: 48px; | |
| 18 background: rgba(153, 153, 153, 0.4); | |
| 19 -webkit-user-select: none;''' | |
| 20 ); | |
| 21 | |
| 22 static Style _iconStyle = new Style(''' | |
| 23 padding: 0px 16px;''' | |
| 24 ); | |
| 25 | |
| 26 static Style _labelStyle = new Style(''' | |
| 27 font-family: 'Roboto Medium', 'Helvetica'; | |
| 28 color: #212121; | |
| 29 padding: 0px 16px; | |
| 30 flex: 1;''' | |
| 31 ); | |
| 32 | |
| 33 List<Node> children; | |
| 34 String icon; | |
| 35 | |
| 36 MenuItem({ Object key, this.icon, this.children }) : super(key: key); | |
| 37 | |
| 38 Node build() { | |
| 39 return new Container( | |
| 40 style: _highlight ? _highlightStyle : _style, | |
| 41 children: [ | |
| 42 super.build(), | |
| 43 new Icon( | |
| 44 style: _iconStyle, | |
| 45 size: 24, | |
| 46 type: "${icon}_grey600" | |
| 47 ), | |
| 48 new Container( | |
| 49 style: _labelStyle, | |
| 50 children: children | |
| 51 ) | |
| 52 ] | |
| 53 ); | |
| 54 } | |
| 55 } | |
| OLD | NEW |