Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use the latest riverpod in flutter version lower than 3.16 #3574

Closed
kefasjw opened this issue May 23, 2024 · 2 comments
Closed

Unable to use the latest riverpod in flutter version lower than 3.16 #3574

kefasjw opened this issue May 23, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@kefasjw
Copy link

kefasjw commented May 23, 2024

Describe the bug

Riverpod uses the collection package version ^1.18.0, but flutter pins the collection package version to 1.17.2. Therefore, the latest stable riverpod (2.5.1) can't be used in flutter version lower than 3.16

To Reproduce

  • Install flutter version 3.13 or lower
  • Add flutter_riverpod: ^2.5.1 dependency to a pubspec.yaml
  • Run flutter pub get

And this error shows up:

Note: collection is pinned to version 1.17.2 by flutter from the flutter SDK.
See https://dart.dev/go/sdk-version-pinning for details.


Because every version of flutter from sdk depends on collection 1.17.2 and riverpod >=2.5.1 <3.0.0-dev.0 depends on collection ^1.18.0, flutter from sdk is
  incompatible with riverpod >=2.5.1 <3.0.0-dev.0.
And because flutter_riverpod >=2.5.1 <3.0.0-dev.0 depends on riverpod 2.5.1, flutter from sdk is incompatible with flutter_riverpod >=2.5.1 <3.0.0-dev.0.
So, because flutter_playground depends on both flutter from sdk and flutter_riverpod 2.5.1, version solving failed.

Expected behavior
flutter riverpod 2.5.1 should be able to be used in older flutter version lower than 3.16. Lower version of collection package should be used instead of 1.18.0.

@kefasjw kefasjw added bug Something isn't working needs triage labels May 23, 2024
@rrousselGit
Copy link
Owner

That's low priority for me. I'd rather have up-to-date dependencies than dealing with broad version ranges.

You can use dependency_overrides to bypass this.

@rrousselGit rrousselGit added enhancement New feature or request and removed bug Something isn't working needs triage labels May 23, 2024
@rrousselGit
Copy link
Owner

Also Riverpod is soon going to require Dart 3 anyway, which requires collection 1.17

So I don't think that's realistic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants