3

I have updated my flutter version and also performed flutter pug upgrade as recommended. But some of the packages were having issues caused by the flutter version. I don't want to downgrade my flutter version but I would like to downgrade the package version as latest version of the package is causing issues and not the old versions (as reported by the community as well).

I specified the package version already but still when I run flutter pub get it still downloads the latest version of the package.

Performed flutter pub cache clean flutter pub cache repair and even dependency_overrides. but still every time I run flutter pub get the latest version of the package is being downloaded as I have the Cache folder open to check.

nerdy kid
  • 371
  • 1
  • 3
  • 14

1 Answers1

4

please try to run flutter clean and remove the "^" before the desired version

good:

enter image description here

wont work:

enter image description here

check this to see what the caret sign(^) does:

What is the caret sign (^) before the dependency version number in Flutter's pubspec.yaml?

Kami Tzayig
  • 126
  • 5
  • Thanks for the quick response! It did solve my issue. deleted the folder in cache first then specified the version without the "^". – nerdy kid Feb 22 '23 at 14:13
  • 1
    to use the latest version always you do "pub get" you can use `firebase_core: any` – G3nt_M3caj Feb 22 '23 at 14:21
  • Yeah this is so strangely working man.. I got stuck doing `flutter clean` and `flutter pub get` and nothing's change.. What I do before is upgrading version in different branch and when I go back to older branch and pub get again somehow version installed is not the same with the one written in `pubspec.yaml` – Fuad Reza Jun 08 '23 at 05:44