fix(pubspec): bump min Dart SDK to 3.0.0 for nonNulls#115
Conversation
`flutter pub publish --dry-run` failed on the v5.7.3 tag because `lib/purchasely_flutter.dart` uses Dart 3.0+ APIs (Iterable.nonNulls, introduced in #88) while the SDK constraint allowed 2.17.3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
| Filename | Overview |
|---|---|
| purchasely/pubspec.yaml | Dart SDK floor bumped from >=2.17.3 to >=3.0.0; flutter constraint >=1.20.0 is now inconsistent with the Dart 3 requirement |
| purchasely_android_player/pubspec.yaml | Dart SDK floor bumped from >=2.17.3 to >=3.0.0; flutter constraint >=2.5.0 is now inconsistent with the Dart 3 requirement |
| purchasely_google/pubspec.yaml | Dart SDK floor bumped from >=2.17.3 to >=3.0.0; flutter constraint >=2.5.0 is now inconsistent with the Dart 3 requirement |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["pubspec sdk: >=2.17.3 <4.0.0"] -->|"Uses Iterable.nonNulls\n(Dart 3.0+ API)"| B["sdk_version_since warning\nduring flutter pub publish --dry-run"]
B --> C["publish.yml fails\nfor v5.7.3"]
C --> D["Bump sdk to >=3.0.0 <4.0.0\nin all 3 pubspec.yaml files"]
D --> E["Warning resolved\npub.dev publish unblocked"]
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
purchasely/pubspec.yaml:8
**Flutter constraint inconsistent with new Dart SDK floor**
The `flutter: ">=1.20.0"` constraint implies compatibility with Flutter versions that ship with Dart 2.x. Flutter 3.10.0 is the first stable release that bundles Dart 3.0.0. While `pub` will correctly block resolution on older Dart SDKs via the `sdk` constraint, the Flutter constraint is misleading to consumers and to pub.dev's compatibility metadata. Consider aligning it to `>=3.10.0`.
### Issue 2 of 2
purchasely_android_player/pubspec.yaml:8
**Flutter constraint inconsistent with new Dart SDK floor**
`flutter: ">=2.5.0"` (Flutter 2.5 shipped with Dart 2.14) is inconsistent with the new `sdk: ">=3.0.0"` constraint. Aligning the Flutter floor to `>=3.10.0` (first stable Flutter release with Dart 3.0) would make the compatibility range accurate. The same issue is present in `purchasely_google/pubspec.yaml`.
Reviews (1): Last reviewed commit: "fix(pubspec): bump min Dart SDK to 3.0.0..." | Re-trigger Greptile
| environment: | ||
| sdk: ">=2.17.3 <4.0.0" | ||
| sdk: ">=3.0.0 <4.0.0" | ||
| flutter: ">=1.20.0" |
There was a problem hiding this comment.
Flutter constraint inconsistent with new Dart SDK floor
The flutter: ">=1.20.0" constraint implies compatibility with Flutter versions that ship with Dart 2.x. Flutter 3.10.0 is the first stable release that bundles Dart 3.0.0. While pub will correctly block resolution on older Dart SDKs via the sdk constraint, the Flutter constraint is misleading to consumers and to pub.dev's compatibility metadata. Consider aligning it to >=3.10.0.
Prompt To Fix With AI
This is a comment left during a code review.
Path: purchasely/pubspec.yaml
Line: 8
Comment:
**Flutter constraint inconsistent with new Dart SDK floor**
The `flutter: ">=1.20.0"` constraint implies compatibility with Flutter versions that ship with Dart 2.x. Flutter 3.10.0 is the first stable release that bundles Dart 3.0.0. While `pub` will correctly block resolution on older Dart SDKs via the `sdk` constraint, the Flutter constraint is misleading to consumers and to pub.dev's compatibility metadata. Consider aligning it to `>=3.10.0`.
How can I resolve this? If you propose a fix, please make it concise.| environment: | ||
| sdk: ">=2.17.3 <4.0.0" | ||
| sdk: ">=3.0.0 <4.0.0" | ||
| flutter: ">=2.5.0" |
There was a problem hiding this comment.
Flutter constraint inconsistent with new Dart SDK floor
flutter: ">=2.5.0" (Flutter 2.5 shipped with Dart 2.14) is inconsistent with the new sdk: ">=3.0.0" constraint. Aligning the Flutter floor to >=3.10.0 (first stable Flutter release with Dart 3.0) would make the compatibility range accurate. The same issue is present in purchasely_google/pubspec.yaml.
Prompt To Fix With AI
This is a comment left during a code review.
Path: purchasely_android_player/pubspec.yaml
Line: 8
Comment:
**Flutter constraint inconsistent with new Dart SDK floor**
`flutter: ">=2.5.0"` (Flutter 2.5 shipped with Dart 2.14) is inconsistent with the new `sdk: ">=3.0.0"` constraint. Aligning the Flutter floor to `>=3.10.0` (first stable Flutter release with Dart 3.0) would make the compatibility range accurate. The same issue is present in `purchasely_google/pubspec.yaml`.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Pull request overview
Updates the three published Flutter packages so their Dart SDK constraints reflect the Dart 3-only Iterable.nonNulls usage already present in the main plugin, with the goal of unblocking the pub publish --dry-run/release flow for v5.7.3.
Changes:
- Bumps the minimum Dart SDK from
2.17.3to3.0.0inpurchasely,purchasely_google, andpurchasely_android_player. - Keeps the package versions aligned at
5.7.3so the release can be retried without introducing additional code changes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
purchasely/pubspec.yaml |
Raises the main plugin's Dart SDK floor to match Dart 3-only API usage. |
purchasely_google/pubspec.yaml |
Raises the Google extension package's Dart SDK floor for release consistency. |
purchasely_android_player/pubspec.yaml |
Raises the Android player extension package's Dart SDK floor for release consistency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| environment: | ||
| sdk: ">=2.17.3 <4.0.0" | ||
| sdk: ">=3.0.0 <4.0.0" | ||
| flutter: ">=1.20.0" |
| environment: | ||
| sdk: ">=2.17.3 <4.0.0" | ||
| sdk: ">=3.0.0 <4.0.0" | ||
| flutter: ">=2.5.0" |
| environment: | ||
| sdk: ">=2.17.3 <4.0.0" | ||
| sdk: ">=3.0.0 <4.0.0" | ||
| flutter: ">=2.5.0" |
Summary
The v5.7.3 publish workflow failed at
flutter pub publish --dry-runwith 4sdk_version_sincewarnings:lib/purchasely_flutter.dartusesIterable.nonNulls(Dart 3.0+, introduced in #88) while pubspecs allowed Dart2.17.3.Bumps the min Dart SDK constraint to
>=3.0.0 <4.0.0in all 3 packages so the v5.7.3 release can publish to pub.dev.Test plan
v5.7.3on the new HEAD to retrigger publish.yml🤖 Generated with Claude Code