fluttercommunity / font_awesome_flutter

The Font Awesome Icon pack available as Flutter Icons
Other
838 stars 238 forks source link

FaDuotoneIcon explicitly requires IconDataDuotone #154

Closed llfbandit closed 3 years ago

llfbandit commented 3 years ago

But generator still outputs IconData for those.

This prevents direct usage of duotone icons. We need to cast each icon IconData to IconDataDuotone.

michaelspiss commented 3 years ago

You mean FontAwesomeIcons.duotoneAbacus needs to be cast to IconDataDuotone before using it in FaDuotoneIcon? If so, could you please attach the output of flutter doctor -v?

llfbandit commented 3 years ago
[√] Flutter (Channel stable, 2.0.2, on Microsoft Windows [version 10.0.19042.867], locale fr-FR)
    • Flutter version 2.0.2 at E:\dev\flutter\current
    • Framework revision 8962f6dc68 (8 days ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at E:\dev\android\sdk
    • Platform android-30, build-tools 29.0.3
    • ANDROID_SDK_ROOT = E:\dev\android\sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java      
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] IntelliJ IDEA Community Edition (version 2020.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.54.3)
    • VS Code at C:\Users\llfbandit\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.20.0

[√] Connected device (3 available)
    • PH 1 (mobile)                         • PM1LHMA820704235 • android-arm64  • Android 10 (API 29)
    • Android SDK built for x86 64 (mobile) • emulator-5554    • android-x64    • Android 10 (API 29) (emulator)
    • Edge (web)                            • edge             • web-javascript • Microsoft Edge 88.0.705.74

! Doctor found issues in 2 categories.

Yes, generator outputs all icon data to IconData, so in NNBD version, we must downcast all duotone icon constants.

drmspatil commented 3 years ago

[√] Flutter (Channel master, 2.1.0-13.0.pre.175, on Microsoft Windows [Version 10.0.18363.1440], locale en-IN) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.5) [√] Android Studio (version 4.1.0) [√] VS Code (version 1.54.3) [√] Connected device (3 available)

jakesterrr123 commented 3 years ago

Showing the same issue here. Duotone icons are casting compile-time errors

llfbandit commented 3 years ago

To avoid unnecessary cast and allow direct usage, please change this line:

https://github.com/fluttercommunity/font_awesome_flutter/blob/b373540b4fda840d2e8ca75ba2653ffc51469d07/tool/generate_font.dart#L189

to...

return '$doc\nstatic const IconDataDuotone $iconName = const IconDataDuotone(0x$primaryUnicode, secondary: const IconDataDuotone(0x$secondaryUnicode),);';
wottpal commented 3 years ago

same issue here

ghenry commented 3 years ago

Just upgraded and hit this error too.

mattmaddux commented 3 years ago

Yup, encountering as well.