flutter
flutter

Reputation: 6776

How to call the icon theme for an icon

In flutter the MaterialApp widget has a theme property where you can set fonts, background colors etc... When I need a text theme for example, using the style property, I can set the theme with Theme.of(context).textTheme.title) . How would I do similar with setting the theme for icons. Icons doesn't have a style property.

Upvotes: 0

Views: 13698

Answers (2)

Hussam
Hussam

Reputation: 1696

You can use the IconTheme class.

new IconTheme(
  data: new IconThemeData(
      color: Colors.blue), 
  child: new Icon(Icons.add),
),

Hope it might help.

Upvotes: 4

Mazin Ibrahim
Mazin Ibrahim

Reputation: 7879

Try replacing the icons you want to style with IconButton widget which has color: property, but you should disable it to hide the effect of user clicks , or you can set the highlighting color to Colors.transparent

Upvotes: 0

Related Questions