You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to use alternative themes of material icons #18384
Google announced a bunch of updates to Material Guidelines during io2018. One of the updates is themes of material icons - https://material.io/tools/icons/
It now has "Filled", "Outlined", "Rounded", "Two-Tone", and "Sharp".
In Flutter, I know how to use regular icons which are "Filled" ones. I also know how I can add individual assets to the assets folder in Flutter app and use those in my code but I'd like if they were readily available so that you could use them like -
IconButton(
icon:Icon(Icons.volume_up), // <=== Point of interest here
tooltip:'Increase volume by 10%',
onPressed: () { setState(() { _volume *=1.1; }); },
)
Looking at this repo I think it only supports default (Filled) right now but are there any plans to add other themes?
Probably
IconButton(
icon:Icon(Icons.volume_up, theme:IconTheme.outlined), // <=== Example
tooltip:'Increase volume by 10%',
onPressed: () { setState(() { _volume *=1.1; }); },
)
Reacted by Cretezy, İhsan Işık, Wendy A, Jonathan White, Andrew Gao, Vladimir Gerashchenko, Sven Schöne, Urmil Shroff, Gavin Henry, Randy Sugianto (Yuku) and 3 more
I believe this is how it would be best implemented:
Have new icons, such as Icons.volume_up_outline, etc. This would make it simple to implement, make all existing tooling work (i.e.: icon in gutter in IDE), and make it clear which icons have other themes (I do not think every icon is implemented in all themes).
I would like to see the following material icons packs. The default ones are starting to look dated. The new packs are quite compelling.
/// Leave the default ones intact so there are no breaking changesIcons.foo;
/// Add new ones with new namesFilledIcons.foo;
OutlinedIcons.foo;
RoundedIcons.foo;
SharpIcons.foo;
/// Not important to me, but it would be cool.TwoToneIcons.foo;
Reacted by Gabriel Rodríguez, Sergei Golishnikov, Naoya Yoshizawa, Anton Holovin, Brian Robles, Jimmy Ye, Lukas Arnold, Greg Wilson, Nick Wu, rineharc and 42 more
Reacted by Julian Bissekkou, Naoya Yoshizawa, Erick Daros, skzwksk, Diego Duarte, codemewell and Marcel Garus
Work is currently underway to bring this functionality and additional optimizations for icons. Can't give a release estimate so in the meanwhile, I'd continue to get the icons you need as png assets from material.io if you're blocked. But it's a current priority.
Reacted by Luke Pighetti, Bernardo Ferrari, Cristian Zazo, Boehrsi, LAIIIHZ, Daniil Lipatkin, miguelpruivo, Muhammad S Maromi, Lorenzo Pieri, sjghose and 10 more
Reacted by Urmil Shroff
Reacted by Joshua Leivenzon, Cristian Zazo, AirborneEagle, Sahaj Rana, Daniil Lipatkin, miguelpruivo, Leonardo Salazar and Travis Reeder
#54923 is last dependent PR. Then we will update the icon font and consts!
Reacted by mono — Masayuki Ono, elixiao, Athul A, Darel Bitsy, Markus Rubey, Yakovlev Maxim, Urmil Shroff, Jaime Blasco, teapot, Daniil Lipatkin and 1 more
Reacted by Marcel Garus, Rohan Chandra, Liam Heß, Athul A, Galen Simmons, Daniil Lipatkin and Justin Shaw
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-]How to use alternative variants of material icons[/-][+]How to use alternative themes of material icons[/+]zoechi commentedon Jun 12, 2018
@HansMuller
pgfepale commentedon Sep 17, 2018
Same question here... Need an outlined icon in a flutter.
lucaslcode commentedon Nov 6, 2018
I've made a package that lets you use the the 'outline' theme only: https://pub.dartlang.org/packages/outline_material_icons
Cretezy commentedon Nov 6, 2018
I believe this is how it would be best implemented:
Have new icons, such as
Icons.volume_up_outline, etc. This would make it simple to implement, make all existing tooling work (i.e.: icon in gutter in IDE), and make it clear which icons have other themes (I do not think every icon is implemented in all themes).I believe we would need to update the tooling for generating the icons to allow other fonts, like using
MaterialIconsOutline(instead of using the defaultMaterialIconsfont). That would be at https://github.com/flutter/flutter/blob/master/dev/tools/update_icons.dartWe also have a wiki page on editing the material fonts, which is a useful references: https://github.com/flutter/flutter/wiki/Updating-Material-Design-Fonts
The OP's proposal of using
IconThemewould conflict with https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/icon_theme.dartThinkDigitalSoftware commentedon Jan 10, 2019
Thank you, sir. Using this
lukepighetti commentedon Jan 31, 2019
I would like to see the following material icons packs. The default ones are starting to look dated. The new packs are quite compelling.
nt4f04uNd commentedon Sep 21, 2019
Ahem, it's september 2019, nothing is done about this???????
abbasnaqdi commentedon Sep 22, 2019
+1
willlarche commentedon Sep 27, 2019
Work is currently underway to bring this functionality and additional optimizations for icons. Can't give a release estimate so in the meanwhile, I'd continue to get the icons you need as png assets from material.io if you're blocked. But it's a current priority.
willlarche commentedon Apr 22, 2020
#54923 is last dependent PR. Then we will update the icon font and consts!
github-actions commentedon Aug 15, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.