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

Unified Diff: sky/framework/components/popup_menu.dart

Issue 1008003007: Add a menu to the stocks app (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Tweak padding Created 5 years, 9 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
Index: sky/framework/components/popup_menu.dart
diff --git a/sky/framework/components/popup_menu.dart b/sky/framework/components/popup_menu.dart
index 4a4aca66f97e85456ba5ae946b02369b1403a06e..8ed4e6c0b4e10967d85b885424371792b8740c9a 100644
--- a/sky/framework/components/popup_menu.dart
+++ b/sky/framework/components/popup_menu.dart
@@ -5,19 +5,27 @@
import '../fn.dart';
import '../theme/colors.dart';
import 'material.dart';
+import 'popup_menu_item.dart';
class PopupMenu extends Component {
static final Style _style = new Style('''
border-radius: 2px;
+ padding: 8px 0;
background-color: ${Grey[50]};'''
);
- List<Node> children;
+ List<List<Node>> items;
int level;
- PopupMenu({ Object key, this.children, this.level }) : super(key: key);
+ PopupMenu({ Object key, this.items, this.level }) : super(key: key);
Node build() {
+ List<Node> children = [];
+ int i = 0;
+ items.forEach((List<Node> item) {
+ children.add(new PopupMenuItem(key: i++, children: item));
+ });
+
return new Material(
style: _style,
children: children,
« sky/examples/stocks-fn/lib/stock_app.dart ('K') | « sky/examples/widgets-fn/widgets_app.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698