plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Request]: Fix mismatch between Dart and Flutter minimum versions across packages

Open mahendrimd opened this issue 6 months ago • 2 comments

Plugin

all relevant packages

Use case

While testing the local build environment for connectivity_plus using its stated minimum Flutter version (3.7.0), I encountered a version constraint mismatch.

Flutter 3.7.0 includes Dart SDK 2.19.0. However, the package constraints require Dart >=3.3.0 <4.0.0 (which implies a minimum of Flutter 3.19.0 or higher).

Attempt to pin the Flutter SDK to the documented minimum version using FVM:

fvm use 3.7.0
SDK Version : 3.7.0 has Dart SDK 2.19.0 does not meet the project constraints of >=3.3.0 <4.0.0.
This could cause unexpected behavior or issues.

Proposal

Since the current Dart SDK constraints already implicitly require a much higher Flutter SDK, it should be safe to bump the minimum flutter version in pubspec.yaml across the affected packages to match the reality.

mahendrimd avatar Jun 05 '26 13:06 mahendrimd

Opened #3877 scoping this to connectivity_plus — bumping its Flutter floor from >=3.7.0 to >=3.16.0 so it matches the sdk: >=3.2.0 constraint (Dart 3.2 first shipped with Flutter 3.16.0). The sibling packages already pair their floors correctly.

rumitvn avatar Jun 15 '26 15:06 rumitvn

Suggestion

To prevent issues like this in the future, we could update CI workflow to extract the minimum Flutter version from pubspec.yaml and test the build against both [minimum_version, latest_stable].

Context: Same problem on android_intent_plus

Using the minimum Flutter version 3.12.0 (which bundles Dart 3.1.0-163.1.beta) fails to satisfy the required minimum Dart 3.1.0.

To work around this, I shifted to Flutter 3.13.0 to satisfy the Dart SDK constraint. However, building example_android then fails because the dev.flutter.flutter-plugin-loader plugin is missing.

This plugin was only introduced in Flutter 3.16.0 (see Release Notes and PR #127897, which modified packages/flutter_tools/gradle/build.gradle.kts).

Proposed Fix

The quick fix is to bump the minimum Flutter version of the example to >=3.16.0. If we go this route, we should probably bump the plugin minimum version as well to keep them aligned.

mahendrimd avatar Jun 20 '26 03:06 mahendrimd