
Raising a Dart package’s minimum SDK version changes which applications can depend on it. Dart 3.14 introduced dart migrate, which previews and applies supported changes as a package moves between Dart 3 language versions. It works on packages whose SDK constraint already requires Dart 3.0 or later. That makes the new dry run especially valuable for a library maintainer who needs to understand both the source edits and the compatibility decision. Dart 3.14 release announcement.
Preview the change from the package root
Take a clean source checkout and record dart --version. Read the existing environment.sdk value in pubspec.yaml. A developer can have a newer SDK installed while their package deliberately promises compatibility with an older one. Verify that the existing tests pass before migrating so you can recognize a break introduced by the change.
Run dart migrate --dry-run to inspect the proposed edits. The default migration advances by one minor version. To evaluate a specific destination, use dart migrate --dry-run --target-sdk=3.14.0. Compare the proposed SDK constraint and source changes. Save the preview alongside the release discussion if another team maintains an app that consumes this package. Dart migration command reference.
Look at the change through a consumer’s eyes
Imagine a parser package used by an internal command-line tool and a Flutter app with a pinned SDK. A clean run of the parser’s own unit tests tells you it works on the SDK used to run those tests. It does not tell you that both consumers’ dependency solvers will accept the new constraint. Try the candidate package in each consumer’s normal build environment and record the resolver message if one can no longer select it.
If a client must remain on its current SDK, decide when to publish the raised minimum and document which package release it can still use. Review any generated source edit in the context of your public API. A changed analyzer diagnostic and a changed output from a parser are different findings, even when they show up in the same migration.
Apply the reviewed edit and rerun the contract tests
When the target version is agreed, run dart migrate --apply --target-sdk=3.14.0. Review the version control diff, run dart pub get, then run analysis and tests. Include one consumer-level check, such as parsing a real saved configuration and comparing the resulting fields. Keep optional cleanup edits in a separate review if they obscure a behavior change. The Dart documentation describes a distinct cleanup step after applying a migration. Dart’s migration and cleanup workflow.
