Home > database >  flutter material icons - the getter 'currency_ruble' isn't defined for the type '
flutter material icons - the getter 'currency_ruble' isn't defined for the type '

Time:12-09

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)

CodePudding user response:

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

CodePudding user response:

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>"))
  • Related