flutter/examples/fn/widgets/menuitem.dart
Rafael Weinstein 409b12e5df Change the name of Component.render to Component.build in Effen.
"Render" is misleading. "Build" may not be the best word either, it's closer to what's actually happening.

R=ojan@chromium.org
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/992033002
2015-03-09 13:30:13 -07:00

56 lines
1.1 KiB
Dart

part of widgets;
class MenuItem extends ButtonBase {
static Style _style = new Style('''
transform: translateX(0);
display: flex;
align-items: center;
height: 48px;
-webkit-user-select: none;'''
);
static Style _highlightStyle = new Style('''
transform: translateX(0);
display: flex;
align-items: center;
height: 48px;
background: rgba(153, 153, 153, 0.4);
-webkit-user-select: none;'''
);
static Style _iconStyle = new Style('''
padding: 0px 16px;'''
);
static Style _labelStyle = new Style('''
font-family: 'Roboto Medium', 'Helvetica';
color: #212121;
padding: 0px 16px;
flex: 1;'''
);
List<Node> children;
String icon;
MenuItem({ Object key, this.icon, this.children }) : super(key: key);
Node build() {
return new Container(
style: _highlight ? _highlightStyle : _style,
children: [
super.build(),
new Icon(
style: _iconStyle,
size: 24,
type: "${icon}_grey600"
),
new Container(
style: _labelStyle,
children: children
)
]
);
}
}