Skip to content

fix(pubspec): bump min Dart SDK to 3.0.0 for nonNulls#115

Merged
kherembourg merged 1 commit intomainfrom
fix/bump-dart-sdk-constraint
May 4, 2026
Merged

fix(pubspec): bump min Dart SDK to 3.0.0 for nonNulls#115
kherembourg merged 1 commit intomainfrom
fix/bump-dart-sdk-constraint

Conversation

@kherembourg
Copy link
Copy Markdown
Collaborator

Summary

The v5.7.3 publish workflow failed at flutter pub publish --dry-run with 4 sdk_version_since warnings: lib/purchasely_flutter.dart uses Iterable.nonNulls (Dart 3.0+, introduced in #88) while pubspecs allowed Dart 2.17.3.

Bumps the min Dart SDK constraint to >=3.0.0 <4.0.0 in all 3 packages so the v5.7.3 release can publish to pub.dev.

Test plan

  • CI green
  • After merge, retag v5.7.3 on the new HEAD to retrigger publish.yml

🤖 Generated with Claude Code

`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>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 4, 2026

Greptile Summary

This PR bumps the minimum Dart SDK constraint from >=2.17.3 to >=3.0.0 across all three published packages to fix sdk_version_since warnings caused by the use of Iterable.nonNulls (a Dart 3.0+ API), unblocking the v5.7.3 pub.dev publish workflow. The change is correct, consistent across all three packages, and the example app (which has publish_to: 'none') is unaffected.

Confidence Score: 4/5

Safe to merge — targeted fix that correctly aligns SDK constraints with actual API usage.

Only P2 findings (Flutter version constraint inconsistency). The core change is correct and necessary for publishing.

All three pubspec.yaml files have a minor Flutter constraint inconsistency (flutter floor is lower than what Dart 3.0 requires), but this does not block merging.

Important Files Changed

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"]
Loading

Fix All in Claude Code Fix All in Cursor Fix All in Codex

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

Comment thread purchasely/pubspec.yaml
environment:
sdk: ">=2.17.3 <4.0.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=1.20.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Fix in Claude Code Fix in Cursor Fix in Codex

environment:
sdk: ">=2.17.3 <4.0.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=2.5.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Fix in Claude Code Fix in Cursor Fix in Codex

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.3 to 3.0.0 in purchasely, purchasely_google, and purchasely_android_player.
  • Keeps the package versions aligned at 5.7.3 so 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.

Comment thread purchasely/pubspec.yaml
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"
@kherembourg kherembourg merged commit 80ae22b into main May 4, 2026
14 checks passed
@kherembourg kherembourg deleted the fix/bump-dart-sdk-constraint branch May 4, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants