flutter_migration_audit
English · 한국어
flutter_migration_audit is a command-line tool that reads the native files of a Flutter app and reports what a migration or an upgrade changes.
It only reads files and never changes the app.
| Command | What it audits |
|---|---|
spm |
What each hand edit in the iOS and macOS Podfile needs when the app moves from CocoaPods to Swift Package Manager. |
edge-to-edge |
What a Flutter upgrade changes for Android system bars and edge-to-edge. |
Install
The tool needs Dart 3.5 or later, which comes with Flutter.
dart pub global activate flutter_migration_audit
If your shell cannot find flutter_migration_audit, run the command through Dart.
dart pub global run flutter_migration_audit --help
To run the code of a checkout of this repository instead, run dart pub global activate --source path . in the checkout.
Usage
flutter_migration_audit spm --input path/to/app
flutter_migration_audit edge-to-edge --from 3.24.5 --to 3.27.1 --input path/to/app
| Option | Meaning |
|---|---|
--input, -i |
The Flutter app directory. The default is the current directory. |
--json |
Print the report as JSON instead of text. |
--from, --to |
edge-to-edge only, and required: the current and the target version. |
--help, -h |
Print the usage of the tool or of a command. |
--version |
Print the version of the tool. |
The reports and the help are in English.
| Exit code | Meaning |
|---|---|
0 |
The report was printed. This is also the code when the report has affected findings. |
64 |
The arguments are wrong, or edge-to-edge does not support the version range. |
66 |
The app directory does not exist. |
CocoaPods to Swift Package Manager (spm)
flutter_migration_audit reads the iOS and macOS files of a Flutter app and tells you, line by line, what each hand edit in your Podfile needs when the app moves from CocoaPods to Swift Package Manager.
Flutter's guide says only that manual Podfile changes "must be manually removed"; this tool says where each one goes, what to do, and how to check that it worked.
It only reads files and never changes the app.
Pass the Flutter app root with its platform directories and Xcode projects.
If a Podfile has no corresponding Xcode project, spm reports needs check and skips that platform's audit.
Check each platform's status before drawing conclusions from the summary counts.
The four plugin-specific checks below require version 0.1.1 or later.
- Every line of
ios/Podfileandmacos/Podfilethat no Flutter Podfile template has. The tool ships every distinct template from the first release tag (v0.1.0) to Flutter 3.50.1 and compares yourPodfilewith the closest one, because Flutter never rewrites an existingPodfileon upgrade. platform :ios/platform :osxagainst the app target's Minimum Deployments, flavor build configuration maps,use_modular_headers!, pod deployment target floors, preprocessor macros,xcodeprojscripts, and pods that an app extension target gets only from CocoaPods.- Flavor schemes without the "Run Prepare Flutter Framework Script" pre-action. Flutter adds it only to the scheme of the build it runs, so a flavor that was never built with Swift Package Manager on lacks it.
#includelines inFlutter/*.xcconfigthat still point atPods/after CocoaPods is removed.- The
PERMISSION_*macros thatpermission_handlerasks for inios/Podfile. Under Swift Package Manager itsPackage.swiftsets them from the usage description keys in the app'sInfo.plistfiles instead. Forpermission_handler_apple9.6.2 to 9.6.5 from pub.dev, the tool finds thoseInfo.plistfiles as thePackage.swiftdoes and tells, for each macro, whether the permission stays as thePodfileset it, and what to change if not. - The
BYPASS_PERMISSION_LOCATION_ALWAYSmacro thatgeolocatorasks for inios/Podfile. Under Swift Package Manager itsPackage.swiftsets the macro from the environment variable of the same name instead. Forgeolocator_apple2.3.15 to 2.4.4 from pub.dev, the tool tells you to set that variable for every build. - The
$FirebaseAnalyticsWithoutAdIdSupportglobal that buildsfirebase_analyticswithout the advertising ID. Under Swift Package Manager itsPackage.swiftmakes this choice from theFIREBASE_ANALYTICS_WITHOUT_ADIDenvironment variable instead. Forfirebase_analytics12.4.3 to 13.1.0 from pub.dev, the tool tells you to set that variable for every build. - The
$AppsFlyerStrictModeand$AppsFlyerPurchaseConnectorglobals inios/Podfile. Forappsflyer_sdkfrom pub.dev, the tool reports that Swift Package Manager drops Strict mode in 7.0.2+2 and 7.0.4, and Purchase Connector in 6.18.1, 7.0.2, 7.0.2+1, 7.0.2+2, and 7.0.4. To keep an enabled feature in those releases, keep CocoaPods for the app. Stable releases through 6.18.0 still use CocoaPods for this plugin because they have no iOSPackage.swift.
Each finding gives a verdict (affected, needs check, not affected) and an input location.
The report gives actions, checks, and quoted sources where available, including commit links for sources that can be pinned.
When no source supports an action, the verdict is needs check and the tool says what to find out instead.
Whether each plugin supports Swift Package Manager is not checked; flutter_spm_doctor does that.
flutter_migration_audit spm --input path/to/app
flutter_migration_audit spm --input path/to/app --json
The Flutter integration rules use Flutter 3.50.0 sources, and the plugin rules use the plugin versions listed above. The SwiftPM build checks describe the migration actions exercised in actual builds.
Android system bars and edge-to-edge (edge-to-edge)
The edge-to-edge command tells whether a Flutter upgrade changes the Android system bars and edge-to-edge behavior of your app.
It takes the current and the target Flutter version and the app directory, and gives each item a verdict with three things attached:
- the clue it found in the app (file and line number)
- the evidence from the official docs as of the target version (quote, docs revision, and a link pinned to a commit)
- a test to run yourself on a device
The verdict is one of affected, not affected, and needs check.
When the input is not enough, or the target version's docs give no evidence, the tool stops at needs check and says what to check.
It only reads the app's files and never changes them.
flutter_migration_audit edge-to-edge --from 3.24.5 --to 3.27.1 --input path/to/app
flutter_migration_audit edge-to-edge --from 3.32.5 --to 3.50.1 --input path/to/app --json
Scope
- Upgrade ranges: Flutter 3.24.x → 3.27.x (default
targetSdk34 → 35, Android 15), and 3.32.x → 3.35.x or 3.32.x → 3.50.x (35 → 36, Android 16).--fromand--tomust be in exactly these minor releases. Other versions, such as 3.24 → 3.29 or 3.32 → 3.38, and an upgrade across bothtargetSdkchanges (for example 3.24 → 3.35) are not accepted. - Topic: Android system bars and edge-to-edge (
targetSdk, the opt-out style,SystemUiMode,SafeAreaandAppBar, system bar colors). - With
--input, pass the Flutter app root or a directory of snippets. The tool reads the app module'sbuild.gradle(.kts), source-set manifests, styles from any XML file inres/values*, and Dart code underlib/when present. It skips test, example, and build directories. For a directory of snippets, place the Gradle script, manifest, or Dart file at the root and keep any qualified styles underres/values*. Missing inputs or atargetSdkthat depends on the build variant can lead toneeds check. - A
SafeAreawidget orSystemUiMode.edgeToEdgecall is a clue for checking a screen. The report asks for a screen-by-screen check when the effect of those clues is uncertain. - The theme it judges: the style that the
NormalThememeta-data of the FlutterActivity inAndroidManifest.xmlpoints to. Without that meta-data, the activity'sandroid:theme(or, without that, the application's theme).- When the opt-out of the launch theme (
LaunchTheme) differs from that style, including a difference only in another device setting such as dark mode, the tool reports it separately asneeds check. In the 3.32 → 3.35 and 3.32 → 3.50 ranges the opt-out of both styles is ignored after the upgrade, so the tool reports only the case where only the launch theme has the opt-out and the launch screen changes. - When a manifest is given but no theme is found, the opt-out item gets
needs check. Without a manifest, the tool judgesNormalTheme, the template default. - With several manifests, the tool judges the one in the default source set
src/main(withoutsrc/main, the first manifest that the tool reads). A build-type manifest (for examplesrc/debug) with another theme or merge instructions (tools:nodeand others) is reported as a note. - The opt-out is judged from the styles in
src/mainand in resource paths without a source set. A style in a build-type source set whose opt-out item or parent differs from thesrc/mainstyle of the same name is reported as a note. - When several activities have the
NormalThememeta-data, the tool judges the launcher (LAUNCHER) activity. When it cannot tell which activity is the launcher, the opt-out item getsneeds check.
- When the opt-out of the launch theme (
- Out of scope: GitHub integration, automatic code changes, and upgrades outside the ranges above.
Evidence from the target version's docs
Each piece of evidence is a quote from the Flutter docs at a required revision: the target version's snapshot of the docs site (a flutter/website commit) or the API docs of the target version's release tag.
The generator tool/extract_evidence.dart extracts the quotes from the docs at those commits and tags, and they ship with the package in lib/src/data/edge_to_edge_evidence.g.dart.
data/manifest/ records the commits, release tags, and pages that the generator reads, as the provenance of those quotes.
At run time the tool needs no network.
The revisions of a page look alike, but they do not say the same thing. The pins hold five revisions of the edge-to-edge migration page: the one before 3.27 shipped, the 3.27, 3.32 and 3.35 revisions, and the current revision, which adds the Android 16 crash workaround. The revisions differ by only a few sentences, and using any revision other than 3.27 as evidence changes the answer. The 3.27 revision says the opt-out applies to "devices running Android SDK 15+", but from the 3.32 revision on it is narrowed to "SDK 15", because an app that targets Android 16 (API 36) cannot opt out on Android 16 devices. So each piece of evidence has a required revision, and a sentence from another revision is not used even when it is the same.
There are two exceptions: the dark mode style (values-night) guidance that the 3.27 revision left out, and the Android 16 crash risk notice added in February 2026, after the 3.35 revision.
Only in these two cases does the tool quote a later revision, and the report marks the quote as "corrected after the target release".
The 3.50 revision already holds both, so for a 3.50 target the tool quotes them from the target revision without that mark.
Supporting a newer Flutter release needs new evidence, which the generator extracts once the specs and the pins cover that release; until then only the ranges above are supported.
An earlier Python version of this audit is kept at the tag python-rag-final.
Example output
This is the output of flutter_migration_audit edge-to-edge --from 3.24.5 --to 3.27.1 --input samples/player_default.
flutter_migration_audit 0.1.1: Android system bars and edge-to-edge
Flutter 3.24.5 → 3.27.1
App: samples/player_default
Inputs: android/app/build.gradle, android/app/src/main/AndroidManifest.xml, android/app/src/main/res/values/styles.xml, android/app/src/main/res/values-night/styles.xml, lib/player_screen.dart
Summary: 5 affected, 0 needs check, 0 not affected
[affected] targetSdk change
targetSdk follows flutter.targetSdkVersion, so it changes from API 34 to API 35 (Android 15).
App clues:
android/app/build.gradle:14 targetSdk = flutter.targetSdkVersion
Doc evidence:
"Prior to Flutter 3.27, Flutter apps target Android 14 by default and won't opt into edge-to-edge mode automatically, but your app _will_ be impacted when you choose to target Android 15. If your app targets `flutter.targetSdkVersion` (as it does by default), then it targets Android 15 starting with Flutter version 3.27, automatically opting your app in to edge-to-edge."
Set default of `SystemUiMode` to edge-to-edge › Context · Flutter 3.27 docs (flutter/website d69db60f99)
Live: https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge
Pinned: https://github.com/flutter/website/blob/d69db60f9945655fa06fcaac573478ff6088003e/src/content/release/breaking-changes/default-systemuimode-edge-to-edge.md
Device tests:
- On a Android 15 (API 35) emulator, open the first screen of the Flutter 3.24 build and of the Flutter 3.27 build, and compare the areas around the status bar and the navigation bar.
[affected] edge-to-edge opt-out
The style `NormalTheme` and its parents have no opt-out item, so on Android 15 and later devices the app draws edge-to-edge.
App clues:
android/app/src/main/AndroidManifest.xml:13 android:resource="@style/NormalTheme"
android/app/src/main/res/values/styles.xml:6 <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
Doc evidence:
"If your Flutter app targets Android SDK version 15 or later, your app automatically displays in edge-to-edge mode, as documented on the `SystemUiMode` API page. To maintain non-edge-to-edge app behavior (including an unset `SystemUiMode`), follow the steps in migration guide."
Set default of `SystemUiMode` to edge-to-edge › Summary · Flutter 3.27 docs (flutter/website d69db60f99)
Live: https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge
Pinned: https://github.com/flutter/website/blob/d69db60f9945655fa06fcaac573478ff6088003e/src/content/release/breaking-changes/default-systemuimode-edge-to-edge.md
Device tests:
- On a Android 15 (API 35) emulator, check whether the app draws behind the status and navigation bars.
[affected] SystemUiMode: immersiveSticky
The Flutter docs say that with targetSdk 35 or later, SystemUiMode.immersiveSticky must follow the edge-to-edge migration guide. The device can behave differently from the docs, so check on a device how the screen changes.
App clues:
lib/player_screen.dart:16 SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
Doc evidence:
"Available starting at Android SDK 4.4 (API 19). Earlier versions of Android will not be affected by this setting. However, if your app targets Android SDK 15 (API 35) or later (Flutter does this by default), then you must migrate using the instructions in https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge to use this mode."
SystemUiMode enum › SystemUiMode.immersiveSticky · Flutter 3.27 docs (flutter/flutter 3.27.0)
Live: https://api.flutter.dev/flutter/services/SystemUiMode.html
Pinned: https://github.com/flutter/flutter/blob/8495dee1fd4aacbe9de707e7581203232f591b2f/packages/flutter/lib/src/services/system_chrome.dart
Device tests:
- On a Android 15 (API 35) emulator, open the screen that uses immersiveSticky mode, and check whether the status and navigation bars hide and how far content draws: behind the status bar, the navigation bar, or the display cutout.
[affected] SystemUiMode: manual
The Flutter docs say that with targetSdk 35 or later, SystemUiMode.manual must follow the edge-to-edge migration guide. The device can behave differently from the docs, so check on a device how the screen changes.
App clues:
lib/player_screen.dart:21 SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);
Doc evidence:
"If your app targets Android SDK 15 (API 35) or later, then you must migrate using the instructions in https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge to use this mode."
SystemUiMode enum › SystemUiMode.manual · Flutter 3.27 docs (flutter/flutter 3.27.0)
Live: https://api.flutter.dev/flutter/services/SystemUiMode.html
Pinned: https://github.com/flutter/flutter/blob/8495dee1fd4aacbe9de707e7581203232f591b2f/packages/flutter/lib/src/services/system_chrome.dart
Device tests:
- On a Android 15 (API 35) emulator, open the screen that sets manual mode, and check whether the requested system bars show and whether content draws behind the status and navigation bars.
[affected] Layout near the system bars
The Scaffold body draws without SafeArea or AppBar, so under edge-to-edge the top content goes behind the status bar.
App clues:
lib/player_screen.dart:27 return Scaffold(
Doc evidence:
"Fullscreen display with status and navigation elements rendered over the application."
SystemUiMode enum › SystemUiMode.edgeToEdge · Flutter 3.27 docs (flutter/flutter 3.27.0)
Live: https://api.flutter.dev/flutter/services/SystemUiMode.html
Pinned: https://github.com/flutter/flutter/blob/8495dee1fd4aacbe9de707e7581203232f591b2f/packages/flutter/lib/src/services/system_chrome.dart
"When running your app on the latest devices, you might encounter bits of the UI being blocked by cutouts on the device's screen. You can fix this with the `SafeArea` widget, which insets its child widget to avoid intrusions (like notches and camera cutouts), as well as operating system UI (such as the status bar on Android), or by rounded corners of the physical display."
SafeArea & MediaQuery › SafeArea · Flutter 3.27 docs (flutter/website d69db60f99)
Live: https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery
Pinned: https://github.com/flutter/website/blob/d69db60f9945655fa06fcaac573478ff6088003e/src/content/ui/adaptive-responsive/safearea-mediaquery.md
"It's generally recommended to wrap the body of a `Scaffold` widget in `SafeArea` as a good place to start, but you don't always need to put it this high in the `Widget` tree."
SafeArea & MediaQuery › SafeArea · Flutter 3.27 docs (flutter/website d69db60f99)
Live: https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery
Pinned: https://github.com/flutter/website/blob/d69db60f9945655fa06fcaac573478ff6088003e/src/content/ui/adaptive-responsive/safearea-mediaquery.md
Device tests:
- On a Android 15 (API 35) emulator, check that text and buttons at the top of the screen do not overlap the status bar, and that buttons at the bottom do not overlap the navigation bar (both 3-button and gesture).
Samples: same upgrade, different results
The two apps in samples/ have the same Dart code and Gradle settings and differ only in styles.xml.
Both use SystemUiMode.immersiveSticky on the video screen, and their targetSdk follows flutter.targetSdkVersion.
| Item | player_default |
player_opt_out |
Emulator result (Android 15) |
|---|---|---|---|
| targetSdk change (34 → 35) | affected | affected | The APK's targetSdk changes from 34 to 35. |
| edge-to-edge opt-out | affected (no opt-out item) | not affected (has the item, a temporary fix) | Only player_default is forced to edge-to-edge. |
immersiveSticky and manual modes |
affected | not applicable | The system bars hide and come back. The hidden screen draws into the cutout area. |
| Layout around the system bars | affected (no SafeArea) | not applicable | The bottom draws under the navigation bar (bottom inset 0 → 24 and 48), and the status bar scrim goes away. |
Because the opt-out applies to player_opt_out, the tool does not check the items after it.
Instead it shows the evidence that the docs call this method a temporary fix.
The last column is the result of building both apps and running them on an Android 15 emulator (comparison capture).
The verdicts matched the real screens.
player_opt_out, however, does not build with the default compileSdk of Flutter 3.24.5 (34).
The opt-out attribute was added in Android 15 (API 35), so adding the opt-out ahead of time on 3.24 needs compileSdk 35 or higher.
Auditing the same two apps for 3.32.5 → 3.35.1 turns the results around, because with targetSdk 36 the opt-out is ignored on Android 16 devices.
| Item | player_default |
player_opt_out |
Emulator result (Android 16) |
|---|---|---|---|
| targetSdk change (35 → 36) | affected | affected | The APK's targetSdk changes from 35 to 36. |
| edge-to-edge opt-out | not affected (already edge-to-edge) | affected (ignored on Android 16 devices) | The opt-out of player_opt_out is ignored. It still applies on Android 15 devices. |
| Opt-out item on Android 16 devices | not applicable | needs check (crash risk notice) | There was no crash in this check. |
immersiveSticky and manual modes |
not applicable | affected | The system bars hide and come back. The hidden screen of player_opt_out draws into the cutout area. |
| Layout around the system bars | not applicable | affected | The bottom of player_opt_out draws under the navigation bar (bottom inset 0 → 24 and 48), and the status bar scrim goes away. |
player_default was already drawn edge-to-edge before the upgrade (targetSdk 35), so this upgrade changes nothing for it.
On Android 15 devices the opt-out of player_opt_out still applies as today, but on Android 16 devices it gets the same impact as player_default in the 3.24 → 3.27 range.
The last column is the result on an Android 16 emulator (comparison capture).
For 3.32.5 → 3.50.1 the tool gives both apps the same verdicts as for 3.32.5 → 3.35.1, because the default targetSdk changes the same way; only the quoted docs revision differs.
The emulator check covered 3.35.1 only.
In both ranges the Flutter docs say that the immersiveSticky and manual modes do not work or are ignored, but in practice the modes worked.
The CLI keeps its verdict and passes that statement on only as a docs quote.
How it was checked, and the results for each device setting, are in docs/device-check.md (in Korean).
Docs
These docs are in the GitHub repository, not in the package. They are in Korean.
- docs/resource-qualifiers.md: how resource qualifiers are handled when judging the opt-out, and the cases that need a check
- docs/device-check.md: the two samples run on emulators, comparing the CLI's verdicts with the real screens
Tests
dart test
The tests compare the CLI output with test/goldens/, and replay the recorded inputs and results in test/data/ through the edge-to-edge readers and rules.