In this post, we are going to show you how to solve Error: No named parameter with the name 'displayLarge' error due to the Google Fonts package in Flutter. This error occurs due to the older version of google_fonts package. See the solution below to solve this error.
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:
^^^^^^^^^^^^
/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({
^^^^^^^^^
To solve this error, Upgrade the google_fonts package in your futter app.
This error may occur even if you haven't used google_fonts package in your project. It's due to some of integrated packages may have used the google_fonts package with this issues. To solve this error at once, add the latest google_fonts package at pubspec.yaml file.
To solve this error, you need to add the latest version of google_fonts package on your app, at least above google_fonts: 2.2.0, For example, I have added latest package at pubspec.yaml file located at root directory of the project.
dependencies:
flutter:
sdk: flutter
google_fonts: ^2.3.1
Now, clean the cache with the following command:
flutter clean
download the integrated packages,
flutter pub get
Now, your issue gets fixed, you can run your app.
In this way, you can solve "Error: No named parameter with the name 'displayLarge' " error due to google_fonts package in Flutter.
Please Wait...
No any Comments on this Article