Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: sky/sdk/lib/widgets/menu_item.dart

Issue 1226583005: Support for selected menu items (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/menu_item.dart
diff --git a/sky/sdk/lib/widgets/menu_item.dart b/sky/sdk/lib/widgets/menu_item.dart
index 76c5de84f163100cf1763c1d53954ca3c266b0ac..98de178cf1a6faab4fbdcf20db0dc5eca933a154 100644
--- a/sky/sdk/lib/widgets/menu_item.dart
+++ b/sky/sdk/lib/widgets/menu_item.dart
@@ -26,17 +26,19 @@ const BoxDecoration _kHighlightBoring = const BoxDecoration(
);
class MenuItem extends ButtonBase {
- MenuItem({ String key, this.icon, this.children, this.onPressed })
+ MenuItem({ String key, this.icon, this.children, this.onPressed, this.selected: false })
: super(key: key);
String icon;
List<Widget> children;
Function onPressed;
+ bool selected;
void syncFields(MenuItem source) {
icon = source.icon;
children = source.children;
onPressed = source.onPressed;
+ selected = source.selected;
super.syncFields(source);
}
@@ -61,7 +63,7 @@ class MenuItem extends ButtonBase {
if (icon != null) {
flexChildren.add(
new Opacity(
- opacity: highlight ? 1.0 : 0.45,
+ opacity: selected ? 1.0 : 0.45,
child: new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0),
child: new Icon(type: "${icon}_${iconSuffix}", size: 24)
@@ -87,9 +89,12 @@ class MenuItem extends ButtonBase {
},
child: new Container(
height: 48.0,
- decoration: highlight ? _kHighlightDecoration : _kHighlightBoring,
- child: new InkWell(
- child: new Flex(flexChildren)
+ decoration: selected ? _kHighlightDecoration : _kHighlightBoring,
+ child: new Container(
+ decoration: highlight ? _kHighlightDecoration : _kHighlightBoring,
+ child: new InkWell(
+ child: new Flex(flexChildren)
+ )
)
)
);
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698