flutter material 图标 - getter 'currency_ruble' 没有为类型 'Icons' 定义
flutter material icons - the getter 'currency_ruble' isn't defined for the type 'Icons'
图标集包含卢布货币,但如果我尝试添加到项目中,我会收到错误消息 The getter 'currency_ruble' isn't defined for the type 'Icons'
IconButton(icon: Icon(Icons.currency_ruble))
扑博士
[√] 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)
Flutter 在设备上有应用程序的缓存版本。 运行
flutter clean
在您的应用程序目录中。
或检查 material 图标依赖是否在 pubspec.yaml 中:
flutter:
uses-material-design: true
“currency_ruble”没有图标。 Currencuy_ruble 不是 IconData 类型。这就是它显示错误的原因。如果你想使用自定义图标然后使用 Image.asset() 如果 currency_ruble 是图像类型或 SvgPicture.asset() 如果它是类型 .svg
IconButton(onPressed: onPressed, icon: Image.asset("<image file name>"))
使用不同的图标遇到了同样的问题。您可以尝试以下任一方法:
使用这个定期更新的 material io 包,看看你的卢布货币是否出现:material_design_icons_flutter package
下载 png 或 svg 并用作资产。
我使用的是 2.8.1,它没有最新的图标。将版本升级到 2.10.5 后,我就能找到丢失的图标。
图标集包含卢布货币,但如果我尝试添加到项目中,我会收到错误消息 The getter 'currency_ruble' isn't defined for the type 'Icons'
IconButton(icon: Icon(Icons.currency_ruble))
扑博士
[√] 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)
Flutter 在设备上有应用程序的缓存版本。 运行
flutter clean
在您的应用程序目录中。
或检查 material 图标依赖是否在 pubspec.yaml 中:
flutter:
uses-material-design: true
“currency_ruble”没有图标。 Currencuy_ruble 不是 IconData 类型。这就是它显示错误的原因。如果你想使用自定义图标然后使用 Image.asset() 如果 currency_ruble 是图像类型或 SvgPicture.asset() 如果它是类型 .svg
IconButton(onPressed: onPressed, icon: Image.asset("<image file name>"))
使用不同的图标遇到了同样的问题。您可以尝试以下任一方法:
使用这个定期更新的 material io 包,看看你的卢布货币是否出现:material_design_icons_flutter package
下载 png 或 svg 并用作资产。
我使用的是 2.8.1,它没有最新的图标。将版本升级到 2.10.5 后,我就能找到丢失的图标。