| 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 'package:sky/widgets/basic.dart'; | 5 import 'package:sky/widgets/basic.dart'; |
| 6 import 'package:sky/widgets/checkbox.dart'; | 6 import 'package:sky/widgets/checkbox.dart'; |
| 7 import 'package:sky/widgets/dialog.dart'; | 7 import 'package:sky/widgets/dialog.dart'; |
| 8 import 'package:sky/widgets/drawer_item.dart'; |
| 8 import 'package:sky/widgets/flat_button.dart'; | 9 import 'package:sky/widgets/flat_button.dart'; |
| 9 import 'package:sky/widgets/icon_button.dart'; | 10 import 'package:sky/widgets/icon_button.dart'; |
| 10 import 'package:sky/widgets/material.dart'; | 11 import 'package:sky/widgets/material.dart'; |
| 11 import 'package:sky/widgets/menu_item.dart'; | |
| 12 import 'package:sky/widgets/navigator.dart'; | 12 import 'package:sky/widgets/navigator.dart'; |
| 13 import 'package:sky/widgets/scaffold.dart'; | 13 import 'package:sky/widgets/scaffold.dart'; |
| 14 import 'package:sky/widgets/scrollable_viewport.dart'; | 14 import 'package:sky/widgets/scrollable_viewport.dart'; |
| 15 import 'package:sky/widgets/switch.dart'; | 15 import 'package:sky/widgets/switch.dart'; |
| 16 import 'package:sky/widgets/tool_bar.dart'; | 16 import 'package:sky/widgets/tool_bar.dart'; |
| 17 | 17 |
| 18 import 'stock_types.dart'; | 18 import 'stock_types.dart'; |
| 19 | 19 |
| 20 typedef void SettingsUpdater({ | 20 typedef void SettingsUpdater({ |
| 21 StockMode optimism, | 21 StockMode optimism, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 Widget buildSettingsPane() { | 88 Widget buildSettingsPane() { |
| 89 // TODO(ianh): Once we have the gesture API hooked up, fix https://github.co
m/domokit/mojo/issues/281 | 89 // TODO(ianh): Once we have the gesture API hooked up, fix https://github.co
m/domokit/mojo/issues/281 |
| 90 // (whereby tapping the widgets below causes both the widget and the menu it
em to fire their callbacks) | 90 // (whereby tapping the widgets below causes both the widget and the menu it
em to fire their callbacks) |
| 91 return new Material( | 91 return new Material( |
| 92 type: MaterialType.canvas, | 92 type: MaterialType.canvas, |
| 93 child: new ScrollableViewport( | 93 child: new ScrollableViewport( |
| 94 child: new Container( | 94 child: new Container( |
| 95 padding: const EdgeDims.symmetric(vertical: 20.0), | 95 padding: const EdgeDims.symmetric(vertical: 20.0), |
| 96 child: new Block([ | 96 child: new Block([ |
| 97 new MenuItem( | 97 new DrawerItem( |
| 98 icon: 'action/thumb_up', | 98 icon: 'action/thumb_up', |
| 99 onPressed: () => _confirmOptimismChange(), | 99 onPressed: () => _confirmOptimismChange(), |
| 100 children: [ | 100 children: [ |
| 101 new Flexible(child: new Text('Everything is awesome')), | 101 new Flexible(child: new Text('Everything is awesome')), |
| 102 new Checkbox(value: optimism == StockMode.optimistic, onChanged:
_handleOptimismChanged) | 102 new Checkbox(value: optimism == StockMode.optimistic, onChanged:
_handleOptimismChanged) |
| 103 ] | 103 ] |
| 104 ), | 104 ), |
| 105 new MenuItem( | 105 new DrawerItem( |
| 106 icon: 'action/backup', | 106 icon: 'action/backup', |
| 107 onPressed: () { _handleBackupChanged(!(backup == BackupMode.enable
d)); }, | 107 onPressed: () { _handleBackupChanged(!(backup == BackupMode.enable
d)); }, |
| 108 children: [ | 108 children: [ |
| 109 new Flexible(child: new Text('Back up stock list to the cloud'))
, | 109 new Flexible(child: new Text('Back up stock list to the cloud'))
, |
| 110 new Switch(value: backup == BackupMode.enabled, onChanged: _hand
leBackupChanged) | 110 new Switch(value: backup == BackupMode.enabled, onChanged: _hand
leBackupChanged) |
| 111 ] | 111 ] |
| 112 ), | 112 ), |
| 113 ]) | 113 ]) |
| 114 ) | 114 ) |
| 115 ) | 115 ) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 139 _handleOptimismChanged(true); | 139 _handleOptimismChanged(true); |
| 140 navigator.pop(); | 140 navigator.pop(); |
| 141 } | 141 } |
| 142 ), | 142 ), |
| 143 ] | 143 ] |
| 144 )); | 144 )); |
| 145 } | 145 } |
| 146 return new Stack(layers); | 146 return new Stack(layers); |
| 147 } | 147 } |
| 148 } | 148 } |
| OLD | NEW |