mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Icon should use an enum rather than an int for size
Material design icons are defined to work at specific sizes: 18, 24, 36, 48. The current API doesn't reflect that and just takes a size int. If an invalid size is chosen an error is printed to the console and no icon shows up. Fixes #1816
This commit is contained in:
parent
dfe47456b9
commit
d749a73805
@ -20,7 +20,7 @@ class Field extends StatelessComponent {
|
||||
return new Row(<Widget>[
|
||||
new Padding(
|
||||
padding: const EdgeDims.symmetric(horizontal: 16.0),
|
||||
child: new Icon(type: icon, size: 24)
|
||||
child: new Icon(type: icon)
|
||||
),
|
||||
new Flexible(
|
||||
child: new Input(
|
||||
@ -43,7 +43,7 @@ class AddressBookHome extends StatelessComponent {
|
||||
|
||||
Widget buildFloatingActionButton(BuildContext context) {
|
||||
return new FloatingActionButton(
|
||||
child: new Icon(type: 'image/photo_camera', size: 24),
|
||||
child: new Icon(type: 'image/photo_camera'),
|
||||
backgroundColor: Theme.of(context).accentColor
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user