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 '../../framework/fn.dart'; | 5 import '../../framework/fn.dart'; |
6 import '../../framework/components/button.dart'; | 6 import '../../framework/components/button.dart'; |
| 7 import '../../framework/components/popup_menu.dart'; |
| 8 import '../../framework/components/popup_menu_item.dart'; |
7 | 9 |
8 class WidgetsApp extends App { | 10 class WidgetsApp extends App { |
| 11 static final Style _menuStyle = new Style(''' |
| 12 position: absolute; |
| 13 top: 200px; |
| 14 left: 200px;'''); |
| 15 |
9 Node build() { | 16 Node build() { |
10 return new Button(content: new Text('Go'), level: 1); | 17 return new Container( |
| 18 children: [ |
| 19 new Button(key: 'Go', content: new Text('Go'), level: 1), |
| 20 new Button(key: 'Back', content: new Text('Back'), level: 3), |
| 21 new Container( |
| 22 style: _menuStyle, |
| 23 children: [ |
| 24 new PopupMenu( |
| 25 children: [ |
| 26 new PopupMenuItem(key: '1', children: [new Text('People & opti
ons')]), |
| 27 new PopupMenuItem(key: '2', children: [new Text('New group con
versation')]), |
| 28 new PopupMenuItem(key: '3', children: [new Text('Turn history
off')]), |
| 29 new PopupMenuItem(key: '4', children: [new Text('Archive')]), |
| 30 new PopupMenuItem(key: '5', children: [new Text('Delete')]), |
| 31 new PopupMenuItem(key: '6', children: [new Text('Un-merge SMS'
)]), |
| 32 new PopupMenuItem(key: '7', children: [new Text('Help & feebac
k')]), |
| 33 ], |
| 34 level: 4), |
| 35 ] |
| 36 ) |
| 37 ] |
| 38 ); |
11 } | 39 } |
12 } | 40 } |
OLD | NEW |