Downgrade flutter package not similar to before the upgrade - flutter

Hello I tried to upgrade in_app_purchase 0.3.4+8 package, so that created some bugs due to somes changes. So I downgrade to return to a fonctionnal version but now it's not working... I only downgrade but it's like a modification in cache or other. How can I fix it ?
I try remove pubspeck.lock and flutter pub cache repair but no change
Thank tou

Related

Error upgrade my Flutter Dart SDK Version

I want to upgrade my flutter dart sdk version but I am getting an error as shown below. Is there anyone who can help me with this? Also can I just upgrade to a specific version instead of the top version?
Try this one
flutter upgrade --force

How to update pubspec.yaml on flutter pub upgrade automatically?

Coming from npm, I deeply dislike the way Google handles package updates within Flutter. Instead of updating the pubspec.yaml on flutter pub upgrade, it will only update the pubspec.lock.
To ensure that the pubspec.yaml is up to date, I have to run flutter pub outdated and manually adjust the pubspec.yaml before running flutter pub upgrade. I'm too lazy for that, it's no fun, I want this to be automated. The recommend versions of flutter pub outdated should be set in the pubspec.yaml for me.
How to I do that?
you can use Ctrl+Space after a package name in pubspec.yaml to get the latest version.
you must press Ctrl+Space exactly one space after ' : ' to see the latest version.
cupertino_icons: <click Ctrl+Space here>

Why I can't add flutter dialogflow dependencies on pub spec.yml

I'm trying to implement chatbot on flutter and I'm trying to add dependencies "flutter_dialogflow: ^0.1.3" in the pub spec.yaml and got error. Can anyone help me how to fix it?
it seems you have run into a dependency incompatibility. if you have more than 5 or 6 dependencies it will be harder to find where this issue comes from. best option to will be,
Upgrade Flutter to the latest Version.
Upgrade all the dependencies to the latest Version. refer pub.dev when upgrading

Flutter Riverpod: pub get failed

I'm currently trying to study using flutter riverpod but i get a problem when i'm trying to put flutter_riverpod package i get this error
Because riverpod depends on flutter_riverpod ^0.9.1 which depends on riverpod ^0.8.0, riverpod ^0.8.0 is required.
So, because riverpod is 1.0.0+1, version solving failed.
Running "flutter pub get" in riverpod...
pub get failed (1; So, because riverpod is 1.0.0+1, version solving failed.)
What can i do to fix this problem? I tried to add riverpod package but it's also not working
I think you should open your pubspec.yaml
at first line. probably your name is riverpod
My issue as well like you. name was flutter_riverpod
Check if your project name is riverpod
For me, that was the issue...
Just use a different name for your project.
See this decision tree created by the developer of riverpod for which version to install.
You only want to install one riverpod dependency.
In short, if you are using flutter_hooks (which I would personally recommend), install hooks_riverpod. If you are not using hooks, install flutter_riverpod.
If you are writing pure dart code (no Flutter), then install riverpod.
To reiterate, your pubspec.yaml should only ever include one riverpod dependency.
If you still have version solving issues with your dependencies after this then try deleting your pubspec.lock and reinstall your dependencies.

how to clean flutter outdated pubs

As the image show, there are several versions of same pubs in my local:
.pub-cache/hosted/pub.dartlang.org/some-version1.
.pub-cache/hosted/pub.dartlang.org/some-version2.
.pub-cache/hosted/pub.dartlang.org/some-version3.
.pub-cache/hosted/pub.dartlang.org/some-version4.
Is there a way to clean them ?
Or clean them by provide a minimal dart version. (like mini dart > 2.6.0) ?
I don't think there is a command for that. Because pub cannot know whether you have an old project lying around that depends on one of these older package versions or not.
The easiest way to clean away old packages is to just delete .pub-cache altogether. When you first run flutter pub get the ones that you actually use will be re-downloaded. This would get rid of the unused ones.
flutter 1.17 provided a new commend: flutter pub outdated. which have good progress on this.