fatal error: google fonts in flutter throws error
2,076
Solution 1
You should try setting a specific version as it seems to be caused by a requirement by the recent google_fonts update.
Using google_fonts:2.1.1
worked for me.
Also check https://github.com/material-foundation/google-fonts-flutter/issues/219 .
Solution 2
i have updated flutter version to 2.10.0 & now it is working
Author by
Janak Vaghasiya
Updated on January 03, 2023Comments
-
Janak Vaghasiya over 1 year
i'm getting this error in flutter
../../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/google_fonts-2.3.0/lib/google_fonts.dart:142265:7: Error: No named parameter with the name 'displayLarge'. displayLarge: ^^^^^^^^^^^^ ../../../snap/flutter/common/flutter/packages/flutter/lib/src/material/text_theme.dart:81:9: Context: Found this candidate, but the arguments don't match. const TextTheme({ ^^^^^^^^^
while running mobile application
some code snippets...
pubspec.yaml
dependencies: flutter: sdk: flutter http: ^0.13.4 cupertino_icons: ^1.0.2 google_fonts: get:
code
Padding( padding: const EdgeInsets.all(8.0), child: Text( 'Details', style: GoogleFonts.pacifico(), ), )
thank you in advance
-
Yeasin Sheikh about 2 yearsCan you try with
flutter clean
and rebuilding the app. -
Janak Vaghasiya about 2 yearsi have already tried that , but it seems like issue is with library & flutter version
-
-
Janak Vaghasiya about 2 yearsyes i have updated version & it works