Index: sky/examples/stocks2/lib/stock_settings.dart |
diff --git a/sky/examples/stocks2/lib/stock_settings.dart b/sky/examples/stocks2/lib/stock_settings.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..11b1c1012a0ccc7849e37330b272c518ad8d2f5d |
--- /dev/null |
+++ b/sky/examples/stocks2/lib/stock_settings.dart |
@@ -0,0 +1,66 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+import 'dart:sky' as sky; |
+ |
+import 'package:sky/theme2/colors.dart' as colors; |
+import 'package:sky/theme2/typography.dart' as typography; |
+import 'package:sky/widgets/basic.dart'; |
+import 'package:sky/widgets/checkbox.dart'; |
+import 'package:sky/widgets/icon_button.dart'; |
+import 'package:sky/widgets/menu_divider.dart'; |
+import 'package:sky/widgets/menu_item.dart'; |
+import 'package:sky/widgets/navigator.dart'; |
+import 'package:sky/widgets/raised_button.dart'; |
+import 'package:sky/widgets/scaffold.dart'; |
+import 'package:sky/widgets/tool_bar.dart'; |
+ |
+class StockSettings extends Component { |
+ |
+ StockSettings(this._navigator); |
+ |
+ Navigator _navigator; |
+ |
+ bool _awesome = false; |
+ void _handleAwesomeChanged(bool value) { |
+ setState(() { |
+ _awesome = value; |
+ }); |
+ } |
+ |
+ Widget buildToolBar() { |
+ return new ToolBar( |
+ left: new IconButton( |
+ icon: 'navigation/arrow_back_white', |
+ onGestureTap: (_) => _navigator.pop()), |
+ center: new Text('Settings', style: typography.white.title), |
+ backgroundColor: colors.Purple[500] |
+ ); |
+ } |
+ |
+ Widget buildSettingsPane() { |
+ return new Container( |
+ padding: const EdgeDims.symmetric(vertical: 20.0), |
+ decoration: new BoxDecoration(backgroundColor: colors.Grey[50]), |
+ child: new Block([ |
+ new MenuItem( |
+ key: 'Optimistic Setting', |
+ icon: 'action/thumb_up', |
+ onGestureTap: (event) => _handleAwesomeChanged(!_awesome), |
+ children: [ |
+ new Flexible(child: new Text('Everything is awesome')), |
+ new Checkbox(key: 'awesome', value: _awesome, onChanged: _handleAwesomeChanged) |
+ ] |
+ ), |
+ ]) |
+ ); |
+ } |
+ |
+ Widget build() { |
+ return new Scaffold( |
+ toolbar: buildToolBar(), |
+ body: buildSettingsPane() |
+ ); |
+ } |
+} |