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

Unified Diff: sky/sdk/example/stocks/lib/stock_menu.dart

Issue 1219493003: Cleanup sky/sdk/examples (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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_list.dart ('k') | sky/sdk/example/stocks/lib/stock_row.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/stocks/lib/stock_menu.dart
diff --git a/sky/sdk/example/stocks/lib/stock_menu.dart b/sky/sdk/example/stocks/lib/stock_menu.dart
index 33d19831685a536f6bb44b06279228a4bb56d1e8..3d6450d27a57b35e3571a7f3e98672f2eb2cbfc1 100644
--- a/sky/sdk/example/stocks/lib/stock_menu.dart
+++ b/sky/sdk/example/stocks/lib/stock_menu.dart
@@ -2,43 +2,42 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'package:sky/framework/fn.dart';
-import 'package:sky/framework/layout.dart';
-import 'package:sky/framework/components/popup_menu.dart';
-import 'package:sky/framework/components/checkbox.dart';
+import 'package:sky/widgets/checkbox.dart';
+import 'package:sky/widgets/popup_menu.dart';
+import 'package:sky/widgets/basic.dart';
import 'package:sky/framework/theme/view_configuration.dart';
class StockMenu extends Component {
- static final Style _style = new Style('''
- position: absolute;
- right: 8px;
- top: ${8 + kStatusBarHeight}px;''');
- PopupMenuController controller;
-
- StockMenu({Object key, this.controller, this.autorefresh: false, this.onAutorefreshChanged}) : super(key: key);
+ StockMenu({
+ String key,
+ this.controller,
+ this.autorefresh: false,
+ this.onAutorefreshChanged
+ }) : super(key: key);
+ final PopupMenuController controller;
final bool autorefresh;
final ValueChanged onAutorefreshChanged;
- static FlexBoxParentData _flex1 = new FlexBoxParentData()..flex = 1;
-
- UINode build() {
+ Widget build() {
var checkbox = new Checkbox(
- checked: this.autorefresh,
+ value: this.autorefresh,
onChanged: this.onAutorefreshChanged
);
- return new StyleNode(
- new PopupMenu(
+ return new Positioned(
+ child: new PopupMenu(
controller: controller,
items: [
- [new Text('Add stock')],
- [new Text('Remove stock')],
- [new ParentDataNode(new Text('Autorefresh'), _flex1), checkbox],
+ new Text('Add stock'),
+ new Text('Remove stock'),
+ new Flex([new Flexible(child: new Text('Autorefresh')), checkbox]),
],
- level: 4),
- _style
+ level: 4
+ ),
+ right: 8.0,
+ top: 8.0 + kStatusBarHeight
);
}
}
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_list.dart ('k') | sky/sdk/example/stocks/lib/stock_row.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698