Skip to content

FaDuotoneIcon explicitly requires IconDataDuotone #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llfbandit opened this issue Mar 12, 2021 · 8 comments
Closed

FaDuotoneIcon explicitly requires IconDataDuotone #154

llfbandit opened this issue Mar 12, 2021 · 8 comments

Comments

@llfbandit
Copy link

llfbandit commented Mar 12, 2021

But generator still outputs IconData for those.

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

@michaelspiss
Copy link
Collaborator

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
Copy link
Author

[√] 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
Copy link

[√] 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
Copy link

jakesterrr123 commented Mar 21, 2021

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

@llfbandit
Copy link
Author

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

return '$doc\nstatic const IconData $iconName = const IconDataDuotone(0x$primaryUnicode, secondary: const IconDataDuotone(0x$secondaryUnicode),);';

to...

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

amkuchta added a commit to amkuchta/font_awesome_flutter that referenced this issue Apr 3, 2021
  - example/lib/example_icon.dart
    - Adds reference to allow duotone (fluttercommunity#154)
  - example/lib/icons.dart
    - Regenerated with duotone null references (fluttercommunity#154)
  - example/lib/main.dart [WIP]
    - Updates hero to allow for duotone icons
  - lib/fonts/*
    - fonts updated
  - tool/generate_example.dart
    - Adds 360-degrees to nameAdjustments (fluttercommunity#158)
    - Updates for duotone icons (fluttercommunity#154)
  - tool/generate_font.dart
   - Adds 360-degrees to nameAdjustments (fluttercommunity#158)
   - Adjusts return of generateDuotoneIconDefinition (fluttercommunity#154)
@wottpal
Copy link

wottpal commented Apr 24, 2021

same issue here

@ghenry
Copy link

ghenry commented Jun 5, 2021

Just upgraded and hit this error too.

@mattmaddux
Copy link

Yup, encountering as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants