material-foundation / flutter-packages

A collection of useful Material Design packages
https://pub.dev/publishers/material.io
Apache License 2.0
834 stars 156 forks source link

Error: Type 'FontFeature' not found. #568

Closed afradahsan closed 7 months ago

afradahsan commented 7 months ago

Package

google_fonts

Existing issue?

What happened?

Expected vs actual result:

When I used google_fonts latest version 6.2.0 in my project i started facing this issue:

/C:/Users/Dell/AppData/Local/Pub/Cache/hosted/pub.dev/google_fonts-6.2.0/lib/src/google_fonts_base.dart:69:8: Error: Type 'FontFeature' not found. List<FontFeature>? fontFeatures,

then i tried downgrading the version, but that didn't seem to work, tried flutter clean and all. but, the issue persists. When i removed the google fonts package, the app started working fine.

image

Would be great if someone could suggest a solution.

Relevant log output

No response

### Tasks
guidezpl commented 7 months ago

Closing as duplicate of https://github.com/material-foundation/flutter-packages/issues/567

Monish-Kumar-D commented 6 months ago

567

568

I encountered a similar error and resolved it by updating the google_fonts dependency in my pubspec.yaml file. fonterror

By removing the caret symbol (^), it ensures that my project uses a compatible version equal to 6.1.0. This resolved the issue for me. Hope this helps! Initially, I had:


google_fonts: ^6.1.0

#However, this caused an error. I realized that it should be:
google_fonts: 6.1.0