Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Error: No named parameter with the name 'displayLarge'

I am working on an app, I posted last update on git 2 days ago and haven't touched the code since. Now, I opened android studio and it was giving me this error when I tried to run it... I tried deleting repository from my computer and then cloning it again but it didn't work. I have also tried searching for similar problems, and found out there was a similar problem with speed-dial package and one comment said something about broken package versions. Anyways, this is the error I am getting after I try running my app:

enter image description here

These are first few lines of the error it's giving me, but there is more than a thousand lines following these.

I also tried running flutter doctor and it gave me the following:

enter image description here

like image 219
Karlo Kajba Šimanić Avatar asked Sep 09 '25 15:09

Karlo Kajba Šimanić


1 Answers

google_fonts: ^2.3.1 has also solved the problems left in google_fonts: 2.3.0

Well! This issue will be raised in all projects using the google_fonts with a caret sign (^).

The caret sign (^) is used for pub dependencies in Dart to indicate a range of version numbers that are allowed. Specifically, any version from the specified version up to (but not including) the next non-breaking version is ok.

So google_fonts: ^2.2.0 is the same as '>=2.2.0 <3.0.0', It's shorthand for the longer form. The ^ is saying, I want to automatically use the most up-to-date package from Pub as long as that update won't break anything in my app. The google_fonts: 2.3.0 has some issues with this as of now.

Solution Steps :

  1. Remove (^) from your current google_fonts. max can be set as google_fonts: 2.2.0.
  2. To make sure, this does not conflict with any other dependency, for once do 'pub get'.
  3. Try to invalidate caches and restart. This should clean error, else do flutter clean to remove old updated google_fonts and pub get.

Done! You are good to go. Happy Codding!!!

like image 155
ViKi Vyas Avatar answered Sep 12 '25 10:09

ViKi Vyas