Address review comments from #767

Mostly formating and removing arguments with default values.
This commit is contained in:
Adam Barth 2015-08-22 10:39:08 -07:00
parent 5d99f31c04
commit 627b049216
3 changed files with 20 additions and 13 deletions

View file

@ -106,15 +106,18 @@ class SettingsFragment extends StatefulComponent {
onPressed: () { _handleBackupChanged(!(userData.backupMode == BackupMode.enabled)); },
child: new Flex([
new Flexible(child: new Text('Back up data to the cloud')),
new Switch(value: userData.backupMode == BackupMode.enabled, onChanged: _handleBackupChanged)
], direction: FlexDirection.horizontal)
new Switch(value: userData.backupMode == BackupMode.enabled, onChanged: _handleBackupChanged),
])
),
new DrawerItem(
onPressed: () => _handleGoalWeightPressed(),
child: new Flex([
new Text('Goal Weight'),
new Text(goalWeightText, style: Theme.of(this).text.caption),
], direction: FlexDirection.vertical, alignItems: FlexAlignItems.start)
new Text('Goal Weight'),
new Text(goalWeightText, style: Theme.of(this).text.caption),
],
direction: FlexDirection.vertical,
alignItems: FlexAlignItems.start
)
),
])
)

View file

@ -126,10 +126,12 @@ class StockHome extends StatefulComponent {
new DrawerItem(
icon: 'action/assessment',
selected: true,
child: new Text('Stock List')),
child: new Text('Stock List')
),
new DrawerItem(
icon: 'action/account_balance',
child: new Text('Account Balance')),
child: new Text('Account Balance')
),
new DrawerDivider(),
new DrawerItem(
icon: 'action/thumb_up',
@ -137,14 +139,16 @@ class StockHome extends StatefulComponent {
child: new Flex([
new Flexible(child: new Text('Optimistic')),
new Radio(value: StockMode.optimistic, groupValue: stockMode, onChanged: _handleStockModeChange)
], direction: FlexDirection.horizontal)),
])
),
new DrawerItem(
icon: 'action/thumb_down',
onPressed: () => _handleStockModeChange(StockMode.pessimistic),
child: new Flex([
new Flexible(child: new Text('Pessimistic')),
new Radio(value: StockMode.pessimistic, groupValue: stockMode, onChanged: _handleStockModeChange)
], direction: FlexDirection.horizontal)),
])
),
new DrawerDivider(),
new DrawerItem(
icon: 'action/settings',

View file

@ -104,16 +104,16 @@ class StockSettings extends StatefulComponent {
onPressed: () => _confirmOptimismChange(),
child: new Flex([
new Flexible(child: new Text('Everything is awesome')),
new Checkbox(value: optimism == StockMode.optimistic, onChanged: (_) => _confirmOptimismChange())
], direction: FlexDirection.horizontal)
new Checkbox(value: optimism == StockMode.optimistic, onChanged: (_) => _confirmOptimismChange()),
])
),
new DrawerItem(
icon: 'action/backup',
onPressed: () { _handleBackupChanged(!(backup == BackupMode.enabled)); },
child: new Flex([
new Flexible(child: new Text('Back up stock list to the cloud')),
new Switch(value: backup == BackupMode.enabled, onChanged: _handleBackupChanged)
], direction: FlexDirection.horizontal)
new Switch(value: backup == BackupMode.enabled, onChanged: _handleBackupChanged),
])
),
])
)