Commit 74d6f33f authored by Adam Barth's avatar Adam Barth

Rename Icon's type paramter to icon

The name of the parameter wasn't consistent with IconButton or DrawerItem, etc.

Fixes #1871
parent 6ee6ae03
...@@ -20,7 +20,7 @@ class Field extends StatelessComponent { ...@@ -20,7 +20,7 @@ class Field extends StatelessComponent {
return new Row(<Widget>[ return new Row(<Widget>[
new Padding( new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeDims.symmetric(horizontal: 16.0),
child: new Icon(type: icon) child: new Icon(icon: icon)
), ),
new Flexible( new Flexible(
child: new Input( child: new Input(
...@@ -43,7 +43,7 @@ class AddressBookHome extends StatelessComponent { ...@@ -43,7 +43,7 @@ class AddressBookHome extends StatelessComponent {
Widget buildFloatingActionButton(BuildContext context) { Widget buildFloatingActionButton(BuildContext context) {
return new FloatingActionButton( return new FloatingActionButton(
child: new Icon(type: 'image/photo_camera'), child: new Icon(icon: 'image/photo_camera'),
backgroundColor: Theme.of(context).accentColor backgroundColor: Theme.of(context).accentColor
); );
} }
......
...@@ -200,7 +200,7 @@ class FeedFragmentState extends State<FeedFragment> { ...@@ -200,7 +200,7 @@ class FeedFragmentState extends State<FeedFragment> {
switch (_fitnessMode) { switch (_fitnessMode) {
case FitnessMode.feed: case FitnessMode.feed:
return new FloatingActionButton( return new FloatingActionButton(
child: new Icon(type: 'content/add'), child: new Icon(icon: 'content/add'),
onPressed: _handleActionButtonPressed onPressed: _handleActionButtonPressed
); );
case FitnessMode.chart: case FitnessMode.chart:
......
...@@ -252,7 +252,7 @@ class StockHomeState extends State<StockHome> { ...@@ -252,7 +252,7 @@ class StockHomeState extends State<StockHome> {
Widget buildFloatingActionButton() { Widget buildFloatingActionButton() {
return new FloatingActionButton( return new FloatingActionButton(
child: new Icon(type: 'content/add'), child: new Icon(icon: 'content/add'),
backgroundColor: Colors.redAccent[200], backgroundColor: Colors.redAccent[200],
onPressed: _handleStockPurchased onPressed: _handleStockPurchased
); );
......
...@@ -62,7 +62,7 @@ Future showStockMenu({BuildContext context, bool autorefresh, ValueChanged<bool> ...@@ -62,7 +62,7 @@ Future showStockMenu({BuildContext context, bool autorefresh, ValueChanged<bool>
new FlatButton( new FlatButton(
child: new Row(<Widget>[ child: new Row(<Widget>[
new Icon( new Icon(
type: 'device/dvr', icon: 'device/dvr',
size: IconSize.s18 size: IconSize.s18
), ),
new Container( new Container(
......
...@@ -329,11 +329,11 @@ class CardCollectionState extends State<CardCollection> { ...@@ -329,11 +329,11 @@ class CardCollectionState extends State<CardCollection> {
backgroundMessage = "Unsupported dismissDirection"; backgroundMessage = "Unsupported dismissDirection";
} }
Widget leftArrowIcon = new Icon(type: 'navigation/arrow_back', size: IconSize.s36); Widget leftArrowIcon = new Icon(icon: 'navigation/arrow_back', size: IconSize.s36);
if (_dismissDirection == DismissDirection.right) if (_dismissDirection == DismissDirection.right)
leftArrowIcon = new Opacity(opacity: 0.1, child: leftArrowIcon); leftArrowIcon = new Opacity(opacity: 0.1, child: leftArrowIcon);
Widget rightArrowIcon = new Icon(type: 'navigation/arrow_forward', size: IconSize.s36); Widget rightArrowIcon = new Icon(icon: 'navigation/arrow_forward', size: IconSize.s36);
if (_dismissDirection == DismissDirection.left) if (_dismissDirection == DismissDirection.left)
rightArrowIcon = new Opacity(opacity: 0.1, child: rightArrowIcon); rightArrowIcon = new Opacity(opacity: 0.1, child: rightArrowIcon);
......
...@@ -48,7 +48,7 @@ class DrawerItem extends StatelessComponent { ...@@ -48,7 +48,7 @@ class DrawerItem extends StatelessComponent {
new Padding( new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeDims.symmetric(horizontal: 16.0),
child: new Icon( child: new Icon(
type: icon, icon: icon,
colorFilter: _getColorFilter(themeData) colorFilter: _getColorFilter(themeData)
) )
) )
......
...@@ -223,7 +223,7 @@ class DropdownButton<T> extends StatelessComponent { ...@@ -223,7 +223,7 @@ class DropdownButton<T> extends StatelessComponent {
alignment: const FractionalOffset(0.5, 0.0) alignment: const FractionalOffset(0.5, 0.0)
), ),
new Container( new Container(
child: new Icon(type: 'navigation/arrow_drop_down', size: IconSize.s36), child: new Icon(icon: 'navigation/arrow_drop_down', size: IconSize.s36),
padding: const EdgeDims.only(top: 6.0) padding: const EdgeDims.only(top: 6.0)
) )
]) ])
......
...@@ -26,16 +26,16 @@ class Icon extends StatelessComponent { ...@@ -26,16 +26,16 @@ class Icon extends StatelessComponent {
Icon({ Icon({
Key key, Key key,
this.size: IconSize.s24, this.size: IconSize.s24,
this.type: '', this.icon: '',
this.color, this.color,
this.colorFilter this.colorFilter
}) : super(key: key) { }) : super(key: key) {
assert(size != null); assert(size != null);
assert(type != null); assert(icon != null);
} }
final IconSize size; final IconSize size;
final String type; final String icon;
final IconThemeColor color; final IconThemeColor color;
final ColorFilter colorFilter; final ColorFilter colorFilter;
...@@ -60,7 +60,7 @@ class Icon extends StatelessComponent { ...@@ -60,7 +60,7 @@ class Icon extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
String category = ''; String category = '';
String subtype = ''; String subtype = '';
List<String> parts = type.split('/'); List<String> parts = icon.split('/');
if (parts.length == 2) { if (parts.length == 2) {
category = parts[0]; category = parts[0];
subtype = parts[1]; subtype = parts[1];
...@@ -80,7 +80,7 @@ class Icon extends StatelessComponent { ...@@ -80,7 +80,7 @@ class Icon extends StatelessComponent {
void debugFillDescription(List<String> description) { void debugFillDescription(List<String> description) {
super.debugFillDescription(description); super.debugFillDescription(description);
description.add('$type'); description.add('$icon');
description.add('size: $size'); description.add('size: $size');
} }
} }
...@@ -27,7 +27,7 @@ class IconButton extends StatelessComponent { ...@@ -27,7 +27,7 @@ class IconButton extends StatelessComponent {
child: new Padding( child: new Padding(
padding: const EdgeDims.all(8.0), padding: const EdgeDims.all(8.0),
child: new Icon( child: new Icon(
type: icon, icon: icon,
color: color, color: color,
colorFilter: colorFilter colorFilter: colorFilter
) )
......
...@@ -320,7 +320,7 @@ class Tab extends StatelessComponent { ...@@ -320,7 +320,7 @@ class Tab extends StatelessComponent {
assert(label.icon != null); assert(label.icon != null);
Color iconColor = selected ? selectedColor : color; Color iconColor = selected ? selectedColor : color;
ColorFilter filter = new ColorFilter.mode(iconColor, TransferMode.srcATop); ColorFilter filter = new ColorFilter.mode(iconColor, TransferMode.srcATop);
return new Icon(type: label.icon, colorFilter: filter); return new Icon(icon: label.icon, colorFilter: filter);
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
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