2

The icon set contains the ruble currency, but if i try to add to the project i get error The getter 'currency_ruble' isn't defined for the type 'Icons'

IconButton(icon: Icon(Icons.currency_ruble))

flutter doctor

[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19042.1348], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.62.3)
[√] Connected device (3 available)
tomerpacific
  • 4,704
  • 13
  • 34
  • 52

4 Answers4

1

encountered the same problem with a different icon. You can try either of the following:

  1. Use this regularly updated material io package and see if your ruble currency appears: material_design_icons_flutter package

  2. Download the png or svg and use as asset instead. enter image description here

dstacklurker
  • 252
  • 2
  • 12
0

Flutter has a cached version of the app on the device . Run

flutter clean 

in your app directory.

OR check whether material icon dependency is in pubspec.yaml or not:

flutter:
uses-material-design: true
gretal
  • 1,092
  • 6
  • 14
  • 1
    Thanks for the help, but the problem is not with the cache. `uses-material-design: true` - enabled. I opened a class `Icons` and there is no `static const IconData` == `currency_ruble` or `currency_yuan` the developers may have forgotten to add, I looked at the github, but the opportunity to ask questions is closed there, so I created a topic here – Александр Инженер Dec 08 '21 at 08:30
0

There is no icons for "currency_ruble". Currencuy_ruble is not of type IconData. That's why it's showing error. If you want to use custom icon then use that icon by using Image.asset() if currency_ruble is of type image or SvgPicture.asset() if it's of type .svg

IconButton(onPressed: onPressed, icon: Image.asset("<image file name>"))
  • Thanks for the help. But if you open a site with google fonts, then there is information about such an icon. https://fonts.google.com/icons?selected=Material%20Icons%3Acurrency_ruble%3A there is also information that it is supported by flutter – Александр Инженер Dec 08 '21 at 08:46
0

I was using 2.8.1 which didn't have latest icons. Once I upgraded the version to 2.10.5 I was able to find the missing icons.