Commit 627b0492 authored by Adam Barth's avatar Adam Barth

Address review comments from #767

Mostly formating and removing arguments with default values.
parent 5d99f31c
...@@ -106,15 +106,18 @@ class SettingsFragment extends StatefulComponent { ...@@ -106,15 +106,18 @@ class SettingsFragment extends StatefulComponent {
onPressed: () { _handleBackupChanged(!(userData.backupMode == BackupMode.enabled)); }, onPressed: () { _handleBackupChanged(!(userData.backupMode == BackupMode.enabled)); },
child: new Flex([ child: new Flex([
new Flexible(child: new Text('Back up data to the cloud')), new Flexible(child: new Text('Back up data to the cloud')),
new Switch(value: userData.backupMode == BackupMode.enabled, onChanged: _handleBackupChanged) new Switch(value: userData.backupMode == BackupMode.enabled, onChanged: _handleBackupChanged),
], direction: FlexDirection.horizontal) ])
), ),
new DrawerItem( new DrawerItem(
onPressed: () => _handleGoalWeightPressed(), onPressed: () => _handleGoalWeightPressed(),
child: new Flex([ child: new Flex([
new Text('Goal Weight'), new Text('Goal Weight'),
new Text(goalWeightText, style: Theme.of(this).text.caption), new Text(goalWeightText, style: Theme.of(this).text.caption),
], direction: FlexDirection.vertical, alignItems: FlexAlignItems.start) ],
direction: FlexDirection.vertical,
alignItems: FlexAlignItems.start
)
), ),
]) ])
) )
......
...@@ -126,10 +126,12 @@ class StockHome extends StatefulComponent { ...@@ -126,10 +126,12 @@ class StockHome extends StatefulComponent {
new DrawerItem( new DrawerItem(
icon: 'action/assessment', icon: 'action/assessment',
selected: true, selected: true,
child: new Text('Stock List')), child: new Text('Stock List')
),
new DrawerItem( new DrawerItem(
icon: 'action/account_balance', icon: 'action/account_balance',
child: new Text('Account Balance')), child: new Text('Account Balance')
),
new DrawerDivider(), new DrawerDivider(),
new DrawerItem( new DrawerItem(
icon: 'action/thumb_up', icon: 'action/thumb_up',
...@@ -137,14 +139,16 @@ class StockHome extends StatefulComponent { ...@@ -137,14 +139,16 @@ class StockHome extends StatefulComponent {
child: new Flex([ child: new Flex([
new Flexible(child: new Text('Optimistic')), new Flexible(child: new Text('Optimistic')),
new Radio(value: StockMode.optimistic, groupValue: stockMode, onChanged: _handleStockModeChange) new Radio(value: StockMode.optimistic, groupValue: stockMode, onChanged: _handleStockModeChange)
], direction: FlexDirection.horizontal)), ])
),
new DrawerItem( new DrawerItem(
icon: 'action/thumb_down', icon: 'action/thumb_down',
onPressed: () => _handleStockModeChange(StockMode.pessimistic), onPressed: () => _handleStockModeChange(StockMode.pessimistic),
child: new Flex([ child: new Flex([
new Flexible(child: new Text('Pessimistic')), new Flexible(child: new Text('Pessimistic')),
new Radio(value: StockMode.pessimistic, groupValue: stockMode, onChanged: _handleStockModeChange) new Radio(value: StockMode.pessimistic, groupValue: stockMode, onChanged: _handleStockModeChange)
], direction: FlexDirection.horizontal)), ])
),
new DrawerDivider(), new DrawerDivider(),
new DrawerItem( new DrawerItem(
icon: 'action/settings', icon: 'action/settings',
......
...@@ -104,16 +104,16 @@ class StockSettings extends StatefulComponent { ...@@ -104,16 +104,16 @@ class StockSettings extends StatefulComponent {
onPressed: () => _confirmOptimismChange(), onPressed: () => _confirmOptimismChange(),
child: new Flex([ child: new Flex([
new Flexible(child: new Text('Everything is awesome')), new Flexible(child: new Text('Everything is awesome')),
new Checkbox(value: optimism == StockMode.optimistic, onChanged: (_) => _confirmOptimismChange()) new Checkbox(value: optimism == StockMode.optimistic, onChanged: (_) => _confirmOptimismChange()),
], direction: FlexDirection.horizontal) ])
), ),
new DrawerItem( new DrawerItem(
icon: 'action/backup', icon: 'action/backup',
onPressed: () { _handleBackupChanged(!(backup == BackupMode.enabled)); }, onPressed: () { _handleBackupChanged(!(backup == BackupMode.enabled)); },
child: new Flex([ child: new Flex([
new Flexible(child: new Text('Back up stock list to the cloud')), new Flexible(child: new Text('Back up stock list to the cloud')),
new Switch(value: backup == BackupMode.enabled, onChanged: _handleBackupChanged) new Switch(value: backup == BackupMode.enabled, onChanged: _handleBackupChanged),
], direction: FlexDirection.horizontal) ])
), ),
]) ])
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment