updated per review feedback
This commit is contained in:
@@ -21,7 +21,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
|
||||
ScaffoldFeatureController _bottomSheet;
|
||||
ListDemoItemSize _itemSize = ListDemoItemSize.threeLine;
|
||||
bool _isDense = true;
|
||||
bool _dense = true;
|
||||
bool _showAvatar = true;
|
||||
bool _showIcon = false;
|
||||
bool _reverseSort = false;
|
||||
@@ -47,7 +47,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
alignItems: FlexAlignItems.stretch,
|
||||
children: <Widget>[
|
||||
new ListItem(
|
||||
isDense: true,
|
||||
dense: true,
|
||||
primary: new Text('One-line'),
|
||||
right: new Radio<ListDemoItemSize>(
|
||||
value: ListDemoItemSize.oneLine,
|
||||
@@ -56,7 +56,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
)
|
||||
),
|
||||
new ListItem(
|
||||
isDense: true,
|
||||
dense: true,
|
||||
primary: new Text('Two-line'),
|
||||
right: new Radio<ListDemoItemSize>(
|
||||
value: ListDemoItemSize.twoLine,
|
||||
@@ -65,7 +65,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
)
|
||||
),
|
||||
new ListItem(
|
||||
isDense: true,
|
||||
dense: true,
|
||||
primary: new Text('Three-line'),
|
||||
right: new Radio<ListDemoItemSize>(
|
||||
value: ListDemoItemSize.threeLine,
|
||||
@@ -74,7 +74,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
)
|
||||
),
|
||||
new ListItem(
|
||||
isDense: true,
|
||||
dense: true,
|
||||
primary: new Text('Show Avatar'),
|
||||
right: new Checkbox(
|
||||
value: _showAvatar,
|
||||
@@ -87,7 +87,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
)
|
||||
),
|
||||
new ListItem(
|
||||
isDense: true,
|
||||
dense: true,
|
||||
primary: new Text('Show Icon'),
|
||||
right: new Checkbox(
|
||||
value: _showIcon,
|
||||
@@ -100,13 +100,13 @@ class ListDemoState extends State<ListDemo> {
|
||||
)
|
||||
),
|
||||
new ListItem(
|
||||
isDense: true,
|
||||
dense: true,
|
||||
primary: new Text('Dense Layout'),
|
||||
right: new Checkbox(
|
||||
value: _isDense,
|
||||
value: _dense,
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
_isDense = value;
|
||||
_dense = value;
|
||||
});
|
||||
_bottomSheet?.setState(() { });
|
||||
}
|
||||
@@ -131,7 +131,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
}
|
||||
return new ListItem(
|
||||
isThreeLine: _itemSize == ListDemoItemSize.threeLine,
|
||||
isDense: _isDense,
|
||||
dense: _dense,
|
||||
left: _showAvatar ? new CircleAvatar(child: new Text(item)) : null,
|
||||
primary: new Text('This item represents $item'),
|
||||
secondary: secondary,
|
||||
@@ -140,7 +140,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
final String layoutText = _isDense ? " \u2013 Dense" : "";
|
||||
final String layoutText = _dense ? " \u2013 Dense" : "";
|
||||
String itemSizeText;
|
||||
switch(_itemSize) {
|
||||
case ListDemoItemSize.oneLine:
|
||||
@@ -176,7 +176,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
]
|
||||
),
|
||||
body: new Block(
|
||||
padding: new EdgeDims.all(_isDense ? 4.0 : 8.0),
|
||||
padding: new EdgeDims.all(_dense ? 4.0 : 8.0),
|
||||
children: items.map((String item) => buildListItem(context, item)).toList()
|
||||
)
|
||||
);
|
||||
|
||||
@@ -94,7 +94,7 @@ class MenuDemoState extends State<MenuDemo> {
|
||||
child: new Text('Context menu item one')
|
||||
),
|
||||
new PopupMenuItem(
|
||||
isDisabled: true,
|
||||
enabled: false,
|
||||
child: new Text('A disabled menu item')
|
||||
),
|
||||
new PopupMenuItem(
|
||||
@@ -178,22 +178,22 @@ class MenuDemoState extends State<MenuDemo> {
|
||||
items: <PopupMenuItem>[
|
||||
new CheckedPopupMenuItem(
|
||||
value: _checkedValue1,
|
||||
isChecked: isChecked(_checkedValue1),
|
||||
checked: isChecked(_checkedValue1),
|
||||
child: new Text(_checkedValue1)
|
||||
),
|
||||
new CheckedPopupMenuItem(
|
||||
isDisabled: true,
|
||||
isChecked: isChecked(_checkedValue2),
|
||||
enabled: false,
|
||||
checked: isChecked(_checkedValue2),
|
||||
child: new Text(_checkedValue2)
|
||||
),
|
||||
new CheckedPopupMenuItem(
|
||||
value: _checkedValue3,
|
||||
isChecked: isChecked(_checkedValue3),
|
||||
checked: isChecked(_checkedValue3),
|
||||
child: new Text(_checkedValue3)
|
||||
),
|
||||
new CheckedPopupMenuItem(
|
||||
value: _checkedValue4,
|
||||
isChecked: isChecked(_checkedValue4),
|
||||
checked: isChecked(_checkedValue4),
|
||||
child: new Text(_checkedValue4)
|
||||
)
|
||||
]
|
||||
|
||||
@@ -221,7 +221,7 @@ class StockHomeState extends State<StockHome> {
|
||||
items: <PopupMenuItem>[
|
||||
new CheckedPopupMenuItem(
|
||||
value: _StockMenuItem.autorefresh,
|
||||
isChecked: _autorefresh,
|
||||
checked: _autorefresh,
|
||||
child: new Text('Autorefresh')
|
||||
),
|
||||
new PopupMenuItem(
|
||||
|
||||
Reference in New Issue
Block a user