ImageIcon (#4649)
Anywhere that accepted IconData now accepts either an Icon or an ImageIcon. Places that used to take an IconData in an `icon` argument, notably IconButton and DrawerItem, now take a Widget in that slot. You can wrap the value that used to be passed in in an Icon constructor to get the same result. Icon itself now takes the icon as a positional argument, for brevity. ThemeData now has an iconTheme as well as a primaryIconTheme, the same way it has had a textTheme and primaryTextTheme for a while. IconTheme.of() always returns a value now (though that value itself may have nulls in it). It defaults to the ThemeData.iconTheme. IconThemeData.fallback() is a new method that returns an icon theme data structure with all fields filled in. IconTheme.merge() is a new constructor that takes a context and creates a widget that mixes in the new values with the inherited values. Most places that introduced an IconTheme widget now use IconTheme.merge. IconThemeData.merge and IconThemeData.copyWith act in a way analogous to the similarly-named members of TextStyle. ImageIcon is introduced. It acts like Icon but takes an ImageProvider instead of an IconData. Also: Fix the analyzer to actually check the stocks app.
This commit is contained in:
@@ -168,14 +168,14 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
||||
mainAxisAlignment: MainAxisAlignment.collapse,
|
||||
children: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.thumb_up,
|
||||
icon: new Icon(Icons.thumb_up),
|
||||
onPressed: () {
|
||||
setState(() => iconButtonToggle = !iconButtonToggle);
|
||||
},
|
||||
color: iconButtonToggle ? Theme.of(context).primaryColor : null
|
||||
),
|
||||
new IconButton(
|
||||
icon: Icons.thumb_up,
|
||||
icon: new Icon(Icons.thumb_up),
|
||||
onPressed: null
|
||||
)
|
||||
]
|
||||
@@ -189,7 +189,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
||||
return new Align(
|
||||
alignment: new FractionalOffset(0.5, 0.4),
|
||||
child: new FloatingActionButton(
|
||||
child: new Icon(icon: Icons.add),
|
||||
child: new Icon(Icons.add),
|
||||
onPressed: () {
|
||||
// Perform some action
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class _ContactCategory extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
new SizedBox(
|
||||
width: 72.0,
|
||||
child: new Icon(icon: icon, color: Theme.of(context).primaryColor)
|
||||
child: new Icon(icon, color: Theme.of(context).primaryColor)
|
||||
),
|
||||
new Flexible(child: new Column(children: children))
|
||||
]
|
||||
@@ -59,7 +59,7 @@ class _ContactItem extends StatelessWidget {
|
||||
if (icon != null) {
|
||||
rowChildren.add(new SizedBox(
|
||||
width: 72.0,
|
||||
child: new IconButton(icon: icon, onPressed: onPressed)
|
||||
child: new IconButton(icon: new Icon(icon), onPressed: onPressed)
|
||||
));
|
||||
}
|
||||
return new Padding(
|
||||
@@ -99,7 +99,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
||||
expandedHeight: _appBarHeight,
|
||||
actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.create,
|
||||
icon: new Icon(Icons.create),
|
||||
tooltip: 'Edit',
|
||||
onPressed: () {
|
||||
_scaffoldKey.currentState.showSnackBar(new SnackBar(
|
||||
|
||||
@@ -39,8 +39,8 @@ class DialogDemoItem extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Icon(
|
||||
icon,
|
||||
size: 36.0,
|
||||
icon: icon,
|
||||
color: color
|
||||
),
|
||||
new Padding(
|
||||
|
||||
@@ -57,7 +57,7 @@ class DateTimeItem extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
new Text(new DateFormat('EEE, MMM d yyyy').format(date)),
|
||||
new Icon(icon: Icons.arrow_drop_down, color: Colors.black54),
|
||||
new Icon(Icons.arrow_drop_down, color: Colors.black54),
|
||||
]
|
||||
)
|
||||
)
|
||||
@@ -82,7 +82,7 @@ class DateTimeItem extends StatelessWidget {
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Text('$time'),
|
||||
new Icon(icon: Icons.arrow_drop_down, color: Colors.black54),
|
||||
new Icon(Icons.arrow_drop_down, color: Colors.black54),
|
||||
]
|
||||
)
|
||||
)
|
||||
@@ -146,7 +146,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(
|
||||
leading: new IconButton(
|
||||
icon: Icons.clear,
|
||||
icon: new Icon(Icons.clear),
|
||||
onPressed: () { handleDismissButton(context); }
|
||||
),
|
||||
title: new Text('New event'),
|
||||
|
||||
@@ -105,7 +105,7 @@ class GridDemoPhotoItem extends StatelessWidget {
|
||||
title: new Text(photo.title),
|
||||
backgroundColor: Colors.black45,
|
||||
leading: new Icon(
|
||||
icon: icon,
|
||||
icon,
|
||||
color: Colors.white
|
||||
)
|
||||
)
|
||||
@@ -122,7 +122,7 @@ class GridDemoPhotoItem extends StatelessWidget {
|
||||
title: new Text(photo.title),
|
||||
subtitle: new Text(photo.caption),
|
||||
trailing: new Icon(
|
||||
icon: icon,
|
||||
icon,
|
||||
color: Colors.white
|
||||
)
|
||||
)
|
||||
|
||||
@@ -47,8 +47,8 @@ class IconsDemoState extends State<IconsDemo> {
|
||||
|
||||
Widget buildIconButton(double size, IconData icon, bool enabled) {
|
||||
return new IconButton(
|
||||
icon: new Icon(icon),
|
||||
size: size,
|
||||
icon: icon,
|
||||
color: iconColor,
|
||||
tooltip: "${enabled ? 'Enabled' : 'Disabled'} icon button",
|
||||
onPressed: enabled ? handleIconButtonPress : null
|
||||
@@ -130,7 +130,7 @@ class IconsDemoState extends State<IconsDemo> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Icon(
|
||||
icon: Icons.brightness_7,
|
||||
Icons.brightness_7,
|
||||
color: iconColor.withAlpha(0x33) // 0.2 * 255 = 0x33
|
||||
),
|
||||
new Slider(
|
||||
@@ -145,7 +145,7 @@ class IconsDemoState extends State<IconsDemo> {
|
||||
}
|
||||
),
|
||||
new Icon(
|
||||
icon: Icons.brightness_7,
|
||||
Icons.brightness_7,
|
||||
color: iconColor.withAlpha(0xFF)
|
||||
),
|
||||
]
|
||||
|
||||
@@ -104,13 +104,13 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
||||
background: new Container(
|
||||
decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
|
||||
child: new ListItem(
|
||||
leading: new Icon(icon: Icons.delete, color: Colors.white, size: 36.0)
|
||||
leading: new Icon(Icons.delete, color: Colors.white, size: 36.0)
|
||||
)
|
||||
),
|
||||
secondaryBackground: new Container(
|
||||
decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
|
||||
child: new ListItem(
|
||||
trailing: new Icon(icon: Icons.archive, color: Colors.white, size: 36.0)
|
||||
trailing: new Icon(Icons.archive, color: Colors.white, size: 36.0)
|
||||
)
|
||||
),
|
||||
child: new Container(
|
||||
|
||||
@@ -144,7 +144,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
leading: _showAvatars ? new CircleAvatar(child: new Text(item)) : null,
|
||||
title: new Text('This item represents $item.'),
|
||||
subtitle: secondary,
|
||||
trailing: _showIcons ? new Icon(icon: Icons.info, color: Theme.of(context).disabledColor) : null
|
||||
trailing: _showIcons ? new Icon(Icons.info, color: Theme.of(context).disabledColor) : null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
title: new Text('Scrolling list\n$itemTypeText$layoutText'),
|
||||
actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.sort_by_alpha,
|
||||
icon: new Icon(Icons.sort_by_alpha),
|
||||
tooltip: 'Sort',
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@@ -185,7 +185,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
}
|
||||
),
|
||||
new IconButton(
|
||||
icon: Icons.more_vert,
|
||||
icon: new Icon(Icons.more_vert),
|
||||
tooltip: 'Show menu',
|
||||
onPressed: () { showConfigurationSheet(context); }
|
||||
)
|
||||
|
||||
@@ -122,21 +122,21 @@ class MenuDemoState extends State<MenuDemo> {
|
||||
new PopupMenuItem<String>(
|
||||
value: 'Preview',
|
||||
child: new ListItem(
|
||||
leading: new Icon(icon: Icons.visibility),
|
||||
leading: new Icon(Icons.visibility),
|
||||
title: new Text('Preview')
|
||||
)
|
||||
),
|
||||
new PopupMenuItem<String>(
|
||||
value: 'Share',
|
||||
child: new ListItem(
|
||||
leading: new Icon(icon: Icons.person_add),
|
||||
leading: new Icon(Icons.person_add),
|
||||
title: new Text('Share')
|
||||
)
|
||||
),
|
||||
new PopupMenuItem<String>(
|
||||
value: 'Get Link',
|
||||
child: new ListItem(
|
||||
leading: new Icon(icon: Icons.link),
|
||||
leading: new Icon(Icons.link),
|
||||
title: new Text('Get link')
|
||||
)
|
||||
),
|
||||
@@ -144,7 +144,7 @@ class MenuDemoState extends State<MenuDemo> {
|
||||
new PopupMenuItem<String>(
|
||||
value: 'Remove',
|
||||
child: new ListItem(
|
||||
leading: new Icon(icon: Icons.delete),
|
||||
leading: new Icon(Icons.delete),
|
||||
title: new Text('Remove')
|
||||
)
|
||||
)
|
||||
|
||||
@@ -74,7 +74,7 @@ class OverscrollDemoState extends State<OverscrollDemo> {
|
||||
title: new Text('$indicatorTypeText'),
|
||||
actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.refresh,
|
||||
icon: new Icon(Icons.refresh),
|
||||
tooltip: 'Pull to refresh',
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@@ -83,7 +83,7 @@ class OverscrollDemoState extends State<OverscrollDemo> {
|
||||
}
|
||||
),
|
||||
new IconButton(
|
||||
icon: Icons.play_for_work,
|
||||
icon: new Icon(Icons.play_for_work),
|
||||
tooltip: 'Over-scroll indicator',
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
|
||||
@@ -39,14 +39,14 @@ class PageSelectorDemo extends StatelessWidget {
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.chevron_left,
|
||||
icon: new Icon(Icons.chevron_left),
|
||||
color: color,
|
||||
onPressed: () { _handleArrowButtonPress(context, -1); },
|
||||
tooltip: 'Page back'
|
||||
),
|
||||
new TabPageSelector<IconData>(),
|
||||
new IconButton(
|
||||
icon: Icons.chevron_right,
|
||||
icon: new Icon(Icons.chevron_right),
|
||||
color: color,
|
||||
onPressed: () { _handleArrowButtonPress(context, 1); },
|
||||
tooltip: 'Page forward'
|
||||
@@ -63,7 +63,7 @@ class PageSelectorDemo extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: new Card(
|
||||
child: new Center(
|
||||
child: new Icon(icon: icon, size: 128.0, color: color)
|
||||
child: new Icon(icon, size: 128.0, color: color)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -61,7 +61,7 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
|
||||
floatingActionButton: new FloatingActionButton(
|
||||
onPressed: null,
|
||||
backgroundColor: Colors.redAccent[200],
|
||||
child: new Icon(icon: Icons.add)
|
||||
child: new Icon(Icons.add)
|
||||
),
|
||||
body: new Center(
|
||||
child: new RaisedButton(
|
||||
|
||||
@@ -66,7 +66,7 @@ class _PestoDemoState extends State<PestoDemo> {
|
||||
appBar: _buildAppBar(context),
|
||||
drawer: _buildDrawer(context),
|
||||
floatingActionButton: new FloatingActionButton(
|
||||
child: new Icon(icon: Icons.edit),
|
||||
child: new Icon(Icons.edit),
|
||||
onPressed: () { }
|
||||
),
|
||||
body: _buildBody(context)
|
||||
@@ -80,7 +80,7 @@ class _PestoDemoState extends State<PestoDemo> {
|
||||
expandedHeight: _kAppBarHeight,
|
||||
actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.search,
|
||||
icon: new Icon(Icons.search),
|
||||
tooltip: 'Search',
|
||||
onPressed: () {
|
||||
_scaffoldKey.currentState.showSnackBar(new SnackBar(
|
||||
@@ -305,7 +305,7 @@ class _RecipePageState extends State<_RecipePage> {
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
leading: new IconButton(
|
||||
icon: Icons.arrow_back,
|
||||
icon: new Icon(Icons.arrow_back),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
tooltip: 'Back'
|
||||
),
|
||||
@@ -364,7 +364,7 @@ class _RecipePageState extends State<_RecipePage> {
|
||||
new Positioned(
|
||||
right: 16.0,
|
||||
child: new FloatingActionButton(
|
||||
child: new Icon(icon: isFavorite ? Icons.favorite : Icons.favorite_border),
|
||||
child: new Icon(isFavorite ? Icons.favorite : Icons.favorite_border),
|
||||
onPressed: _toggleFavorite
|
||||
)
|
||||
)
|
||||
@@ -384,7 +384,7 @@ class _RecipePageState extends State<_RecipePage> {
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: const EdgeInsets.only(right: 24.0),
|
||||
child: new Icon(icon: icon, color: Colors.black54)
|
||||
child: new Icon(icon, color: Colors.black54)
|
||||
),
|
||||
new Text(label, style: menuItemStyle)
|
||||
]
|
||||
|
||||
@@ -78,9 +78,9 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> {
|
||||
value: (IconData icon) {
|
||||
switch(_demoStyle) {
|
||||
case TabsDemoStyle.iconsAndText:
|
||||
return new TabLabel(text: labels[icon], icon: icon);
|
||||
return new TabLabel(text: labels[icon], icon: new Icon(icon));
|
||||
case TabsDemoStyle.iconsOnly:
|
||||
return new TabLabel(icon: icon);
|
||||
return new TabLabel(icon: new Icon(icon));
|
||||
case TabsDemoStyle.textOnly:
|
||||
return new TabLabel(text: labels[icon]);
|
||||
}
|
||||
@@ -96,7 +96,7 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> {
|
||||
child:new Card(
|
||||
child: new Center(
|
||||
child: new Icon(
|
||||
icon: icon,
|
||||
icon,
|
||||
color: iconColor,
|
||||
size: 128.0
|
||||
)
|
||||
|
||||
@@ -55,7 +55,7 @@ class OrderItem extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: new Center(
|
||||
child: new Icon(
|
||||
icon: Icons.info_outline,
|
||||
Icons.info_outline,
|
||||
size: 24.0,
|
||||
color: const Color(0xFFFFE0E0)
|
||||
)
|
||||
@@ -175,7 +175,7 @@ class _OrderPageState extends State<OrderPage> {
|
||||
},
|
||||
backgroundColor: const Color(0xFF16F0F0),
|
||||
child: new Icon(
|
||||
icon: Icons.add_shopping_cart,
|
||||
Icons.add_shopping_cart,
|
||||
color: Colors.black
|
||||
)
|
||||
),
|
||||
|
||||
@@ -100,7 +100,7 @@ class ShrinePageState extends State<ShrinePage> {
|
||||
),
|
||||
actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.shopping_cart,
|
||||
icon: new Icon(Icons.shopping_cart),
|
||||
tooltip: 'Shopping cart',
|
||||
onPressed: () {
|
||||
_showShoppingCart();
|
||||
|
||||
@@ -15,7 +15,7 @@ class _Page {
|
||||
Color get labelColor => colors != null ? colors[300] : Colors.grey[300];
|
||||
bool get fabDefined => colors != null && icon != null;
|
||||
Color get fabColor => colors[400];
|
||||
Icon get fabIcon => new Icon(icon: icon);
|
||||
Icon get fabIcon => new Icon(icon);
|
||||
Key get fabKey => new ValueKey<Color>(fabColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ class TooltipDemo extends StatelessWidget {
|
||||
new Tooltip(
|
||||
message: 'call icon',
|
||||
child: new Icon(
|
||||
Icons.call,
|
||||
size: 18.0,
|
||||
icon: Icons.call,
|
||||
color: theme.primaryColor
|
||||
)
|
||||
),
|
||||
@@ -42,7 +42,7 @@ class TooltipDemo extends StatelessWidget {
|
||||
new Center(
|
||||
child: new IconButton(
|
||||
size: 48.0,
|
||||
icon: Icons.call,
|
||||
icon: new Icon(Icons.call),
|
||||
color: theme.primaryColor,
|
||||
tooltip: 'Place a phone call',
|
||||
onPressed: () {
|
||||
|
||||
@@ -158,7 +158,7 @@ class DemoBottomBar extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: new EdgeInsets.only(right: 8.0),
|
||||
child: new Icon(icon: Icons.code)
|
||||
child: new Icon(Icons.code)
|
||||
),
|
||||
new Text('VIEW CODE')
|
||||
]
|
||||
@@ -170,7 +170,7 @@ class DemoBottomBar extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: new EdgeInsets.only(right: 8.0),
|
||||
child: new Icon(icon: Icons.star)
|
||||
child: new Icon(Icons.star)
|
||||
),
|
||||
new Text('LIVE DEMO')
|
||||
]
|
||||
@@ -267,7 +267,7 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(
|
||||
leading: new IconButton(
|
||||
icon: Icons.clear,
|
||||
icon: new Icon(Icons.clear),
|
||||
onPressed: () { Navigator.pop(context); }
|
||||
),
|
||||
title: new Text('Example code')
|
||||
|
||||
@@ -36,7 +36,7 @@ class GalleryDrawer extends StatelessWidget {
|
||||
content: new Center(child: new Text('Flutter gallery'))
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.brightness_5,
|
||||
icon: new Icon(Icons.brightness_5),
|
||||
onPressed: () { onThemeChanged(true); },
|
||||
selected: useLightTheme,
|
||||
child: new Row(
|
||||
@@ -51,7 +51,7 @@ class GalleryDrawer extends StatelessWidget {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.brightness_7,
|
||||
icon: new Icon(Icons.brightness_7),
|
||||
onPressed: () { onThemeChanged(false); },
|
||||
selected: useLightTheme,
|
||||
child: new Row(
|
||||
@@ -67,7 +67,7 @@ class GalleryDrawer extends StatelessWidget {
|
||||
),
|
||||
new Divider(),
|
||||
new DrawerItem(
|
||||
icon: Icons.hourglass_empty,
|
||||
icon: new Icon(Icons.hourglass_empty),
|
||||
selected: timeDilation != 1.0,
|
||||
onPressed: () { onTimeDilationChanged(timeDilation != 1.0 ? 1.0 : 20.0); },
|
||||
child: new Row(
|
||||
@@ -81,7 +81,7 @@ class GalleryDrawer extends StatelessWidget {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.assessment,
|
||||
icon: new Icon(Icons.assessment),
|
||||
onPressed: () { onShowPerformanceOverlayChanged(!showPerformanceOverlay); },
|
||||
selected: showPerformanceOverlay,
|
||||
child: new Row(
|
||||
|
||||
@@ -83,7 +83,7 @@ bool value;
|
||||
|
||||
// Toggleable icon button.
|
||||
new IconButton(
|
||||
icon: Icons.thumb_up,
|
||||
icon: new Icon(Icons.thumb_up),
|
||||
onPressed: () {
|
||||
setState(() => value = !value);
|
||||
},
|
||||
@@ -99,7 +99,7 @@ new Scaffold(
|
||||
title: new Text('Demo')
|
||||
),
|
||||
floatingActionButton: new FloatingActionButton(
|
||||
child: new Icon(icon: Icons.add),
|
||||
child: new Icon(Icons.add),
|
||||
onPressed: null
|
||||
)
|
||||
);
|
||||
|
||||
@@ -80,17 +80,17 @@ class GalleryHomeState extends State<GalleryHome> {
|
||||
type: MaterialListType.oneLine,
|
||||
children: <Widget>[
|
||||
new TwoLevelSublist(
|
||||
leading: new Icon(icon: Icons.star),
|
||||
leading: new Icon(Icons.star),
|
||||
title: new Text('Demos'),
|
||||
children: _demoItems
|
||||
),
|
||||
new TwoLevelSublist(
|
||||
leading: new Icon(icon: Icons.extension),
|
||||
leading: new Icon(Icons.extension),
|
||||
title: new Text('Components'),
|
||||
children: _componentItems
|
||||
),
|
||||
new TwoLevelSublist(
|
||||
leading: new Icon(icon: Icons.color_lens),
|
||||
leading: new Icon(Icons.color_lens),
|
||||
title: new Text('Style'),
|
||||
children: _styleItems
|
||||
)
|
||||
|
||||
@@ -52,7 +52,7 @@ class AdaptedGridItem extends StatelessWidget {
|
||||
child: new Text(name)
|
||||
),
|
||||
new IconButton(
|
||||
icon: Icons.more_vert,
|
||||
icon: new Icon(Icons.more_vert),
|
||||
onPressed: null
|
||||
)
|
||||
]
|
||||
|
||||
@@ -26,10 +26,11 @@ class _NotImplementedDialog extends StatelessWidget {
|
||||
content: new Text('This feature has not yet been implemented.'),
|
||||
actions: <Widget>[
|
||||
new FlatButton(
|
||||
onPressed: () { debugDumpApp(); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Icon(
|
||||
icon: Icons.dvr,
|
||||
Icons.dvr,
|
||||
size: 18.0
|
||||
),
|
||||
new Container(
|
||||
@@ -37,14 +38,13 @@ class _NotImplementedDialog extends StatelessWidget {
|
||||
),
|
||||
new Text('DUMP APP TO CONSOLE'),
|
||||
]
|
||||
),
|
||||
onPressed: () { debugDumpApp(); }
|
||||
)
|
||||
),
|
||||
new FlatButton(
|
||||
child: new Text('OH WELL'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, false);
|
||||
}
|
||||
},
|
||||
child: new Text('OH WELL')
|
||||
)
|
||||
]
|
||||
);
|
||||
@@ -126,12 +126,12 @@ class StockHomeState extends State<StockHome> {
|
||||
child: new Block(children: <Widget>[
|
||||
new DrawerHeader(content: new Center(child: new Text('Stocks'))),
|
||||
new DrawerItem(
|
||||
icon: Icons.assessment,
|
||||
icon: new Icon(Icons.assessment),
|
||||
selected: true,
|
||||
child: new Text('Stock List')
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.account_balance,
|
||||
icon: new Icon(Icons.account_balance),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
@@ -158,7 +158,7 @@ class StockHomeState extends State<StockHome> {
|
||||
child: new Text('Account Balance')
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.dvr,
|
||||
icon: new Icon(Icons.dvr),
|
||||
onPressed: () {
|
||||
try {
|
||||
debugDumpApp();
|
||||
@@ -173,7 +173,7 @@ class StockHomeState extends State<StockHome> {
|
||||
),
|
||||
new Divider(),
|
||||
new DrawerItem(
|
||||
icon: Icons.thumb_up,
|
||||
icon: new Icon(Icons.thumb_up),
|
||||
onPressed: () => _handleStockModeChange(StockMode.optimistic),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -183,7 +183,7 @@ class StockHomeState extends State<StockHome> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.thumb_down,
|
||||
icon: new Icon(Icons.thumb_down),
|
||||
onPressed: () => _handleStockModeChange(StockMode.pessimistic),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -194,11 +194,11 @@ class StockHomeState extends State<StockHome> {
|
||||
),
|
||||
new Divider(),
|
||||
new DrawerItem(
|
||||
icon: Icons.settings,
|
||||
icon: new Icon(Icons.settings),
|
||||
onPressed: _handleShowSettings,
|
||||
child: new Text('Settings')),
|
||||
new DrawerItem(
|
||||
icon: Icons.help,
|
||||
icon: new Icon(Icons.help),
|
||||
child: new Text('Help & Feedback'))
|
||||
])
|
||||
);
|
||||
@@ -214,7 +214,7 @@ class StockHomeState extends State<StockHome> {
|
||||
title: new Text(StockStrings.of(context).title()),
|
||||
actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.search,
|
||||
icon: new Icon(Icons.search),
|
||||
onPressed: _handleSearchBegin,
|
||||
tooltip: 'Search'
|
||||
),
|
||||
@@ -307,7 +307,7 @@ class StockHomeState extends State<StockHome> {
|
||||
Widget buildSearchBar() {
|
||||
return new AppBar(
|
||||
leading: new IconButton(
|
||||
icon: Icons.arrow_back,
|
||||
icon: new Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).accentColor,
|
||||
onPressed: _handleSearchEnd,
|
||||
tooltip: 'Back'
|
||||
@@ -332,7 +332,7 @@ class StockHomeState extends State<StockHome> {
|
||||
Widget buildFloatingActionButton() {
|
||||
return new FloatingActionButton(
|
||||
tooltip: 'Create company',
|
||||
child: new Icon(icon: Icons.add),
|
||||
child: new Icon(Icons.add),
|
||||
backgroundColor: Colors.redAccent[200],
|
||||
onPressed: _handleCreateCompany
|
||||
);
|
||||
|
||||
@@ -104,7 +104,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
Widget buildSettingsPane(BuildContext context) {
|
||||
List<Widget> rows = <Widget>[
|
||||
new DrawerItem(
|
||||
icon: Icons.thumb_up,
|
||||
icon: new Icon(Icons.thumb_up),
|
||||
onPressed: () => _confirmOptimismChange(),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -117,7 +117,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.backup,
|
||||
icon: new Icon(Icons.backup),
|
||||
onPressed: () { _handleBackupChanged(!(config.configuration.backupMode == BackupMode.enabled)); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -130,7 +130,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.picture_in_picture,
|
||||
icon: new Icon(Icons.picture_in_picture),
|
||||
onPressed: () { _handleShowPerformanceOverlayChanged(!config.configuration.showPerformanceOverlay); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -143,7 +143,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.accessibility,
|
||||
icon: new Icon(Icons.accessibility),
|
||||
onPressed: () { _handleShowSemanticsDebuggerChanged(!config.configuration.showSemanticsDebugger); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -158,9 +158,9 @@ class StockSettingsState extends State<StockSettings> {
|
||||
];
|
||||
assert(() {
|
||||
// material grid and size construction lines are only available in checked mode
|
||||
rows.addAll([
|
||||
rows.addAll(<Widget>[
|
||||
new DrawerItem(
|
||||
icon: Icons.border_clear,
|
||||
icon: new Icon(Icons.border_clear),
|
||||
onPressed: () { _handleShowGridChanged(!config.configuration.debugShowGrid); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -173,7 +173,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.border_all,
|
||||
icon: new Icon(Icons.border_all),
|
||||
onPressed: () { _handleShowSizesChanged(!config.configuration.debugShowSizes); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -186,7 +186,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.format_color_text,
|
||||
icon: new Icon(Icons.format_color_text),
|
||||
onPressed: () { _handleShowBaselinesChanged(!config.configuration.debugShowBaselines); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -199,7 +199,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.filter_none,
|
||||
icon: new Icon(Icons.filter_none),
|
||||
onPressed: () { _handleShowLayersChanged(!config.configuration.debugShowLayers); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -212,7 +212,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.mouse,
|
||||
icon: new Icon(Icons.mouse),
|
||||
onPressed: () { _handleShowPointersChanged(!config.configuration.debugShowPointers); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -225,7 +225,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
)
|
||||
),
|
||||
new DrawerItem(
|
||||
icon: Icons.gradient,
|
||||
icon: new Icon(Icons.gradient),
|
||||
onPressed: () { _handleShowRainbowChanged(!config.configuration.debugShowRainbow); },
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
|
||||
Reference in New Issue
Block a user