Skip to content

[tabs_overlay] Update to Flutter 3.47 and fix the Android build - #237

Open
pjkammer wants to merge 7 commits into
flutter:mainfrom
pjkammer:tabs-overlay-update
Open

pjkammer wants to merge 7 commits into
flutter:mainfrom
pjkammer:tabs-overlay-update

Conversation

@pjkammer

@pjkammer pjkammer commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Brings tabs_overlay up to date with Flutter 3.47, still on package:flutter/material.dart (migrating to material_ui #239). On main the Android app doesn't build: its Gradle 6.7 project can't run on the JDK that Flutter uses. iOS builds work, but each build rewrites tracked Xcode files.

Commits:

  1. Dependencies and lints. SDK constraint to ^3.13.0 (material_ui's minimum), unused cupertino_icons removed, analysis_options.yaml from flutter create, then flutter pub upgrade --major-versions (flutter_lints ^6.0.0). This drops archive 3.3.2, resolving GHSA-9v85-q87q-g4vg and GHSA-r285-q736-9v95.
  2. dart fix for use_super_parameters.
  3. dart format.
  4. Flutter's automatic iOS project migrations, from flutter build ios --simulator --debug, unmodified.
  5. Android project recreated with flutter create, keeping the app's own Kotlin code, layouts and theme. The template's values-night theme is dropped: it isn't an AppCompat theme, so MainActivity (an AppCompatActivity) would crash in dark mode, and the app's DayNight theme already covers dark mode.
  6. AndroidX dependencies the old project declared (hand edit). Material Components stays at 1.4.0 because the native tabs are the comparison reference. Lifecycle moves to 2.7.0, matching Flutter's embedding, so PageViewModel calls LiveData.map as an extension.
  7. fitsSystemWindows on the native app bar (hand edit). With targetSdk 36 (Flutter 3.47's default), Android 15+ draws the app edge to edge. The native tab bar sat a status bar's height above Flutter's, so taps on it missed Flutter's tabs.

Tested with Flutter 3.47.7: flutter analyze, flutter test and dart format are clean, and the integration test passes on an iPhone 17 Pro simulator (iOS 26.4) and a Pixel 8 emulator (Android 17). On Android, tapping a native tab switches both tab views, and dark mode works.

Unchanged: on iOS, tapping a tab moves only the Flutter view, because the iOS side has no native tab bar (swiping moves both). Same on main. iOS builds still print the UIScene migration warning, a separate follow-up.

There is no tracking issue. This is cleanup before the material_ui migration.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
    No new tests: the Dart changes are a lint fix and formatting, and the native project changes were checked by hand on both platforms (above).
  • All existing and new tests are passing.
    No CI runs tests here. Locally, flutter test passes, and the integration test passes on iOS and Android.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

1. Copied analysis_options.yaml from `flutter create` (Flutter 3.47.7).
   (Adds analyzer excludes and updates lint doc link)
2. Updated pubspec.yaml to
   - Raise SDK constraint to ^3.13.0 to match material_ui.
   - Remove unused cupertino_icons.
3. flutter pub upgrade --major-versions
   - raises flutter_lints from ^2.0.3 to ^6.0.0
   - archive 3.3.2 is no longer a dependency,
     which resolves GHSA-9v85-q87q-g4vg and GHSA-r285-q736-9v95
Identified with `flutter analyze` and updated with
`dart fix --apply --code=use_super_parameters`
Generated with `dart format` (Dart 3.13.5)
Generated by `flutter build ios --simulator --debug` on Flutter 3.47.7

No hand edits. Tool output:
```
Resolving dependencies...
Downloading packages...
  material_color_utilities 0.13.0 (0.13.1 available)
  test_api 0.7.12 (0.7.15 available)
Got dependencies!
2 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Building com.example.tabsOverlay for simulator (ios)...
Updating minimum iOS deployment target to 15.0.
Upgrading project.pbxproj
Upgrading AppFrameworkInfo.plist
Updating project for Xcode compatibility.
Upgrading project.pbxproj
Upgrading Runner.xcscheme
Upgrading Info.plist
Removing script build phase dependency analysis.
Adding input path to Thin Binary build phase.
ios/Runner/AppDelegate.swift uses the deprecated @UIApplicationMain attribute, updating.
Adding Swift Package Manager integration...                         4.4s
Upgrading Runner.xcscheme
To ensure your app continues to launch on upcoming iOS versions, UIScene lifecycle support will soon be required. Please see https://flutter.dev/to/uiscene-migration for the migration guide.

Running Xcode build...
Xcode build done.                                           20.2s
✓ Built build/ios/iphonesimulator/Runner.app
```
The old project (Gradle 6.7, AGP 4.1.0, `apply from: flutter.gradle`) no
longer builds with current Flutter.

Steps, run from the tabs_overlay directory:
1. rm -rf android
2. flutter create --platforms=android --org com.example \
        --project-name tabs_overlay .
3. git restore pubspec.lock .metadata  # unrelated from flutter create
4. rm test/widget_test.dart            # template sample test

   # Restore the app's native code and theme
5. git restore android/app/src/main/kotlin \
               android/app/src/main/res/layout \
               android/app/src/main/res/values

   # Drop the template's night theme (see below)
6. rm -r  android/app/src/main/res/values-night

Why remove values-night: The template's values-night/styles.xml
redefines LaunchTheme and NormalTheme on Theme.Black.NoTitleBar, which
isn't an AppCompat theme.  MainActivity is an AppCompatActivity, so in
dark mode the app would crash ("You need to use a Theme.AppCompat theme
(or descendant) with this activity"). The app's own values/styles.xml
already handles dark mode through Theme.MaterialComponents.DayNight.

No hand edits.

Doesn't build on its own. The template has no AndroidX dependencies.
The next commit will add those.
Hand edits to make the native side build:

- android/app/build.gradle.kts: add in dependencies old project
  declared.
  - material (keep at 1.4.0 rather than risk changing native tab
    appearance)
  - lifecycle moves explicitly to 2.7.0 to match flutter embedding
  - explicit kotlin-stdlib-jdk7 isn't needed. It's included by the
    Kotlin Gradle plugin.
- PageViewModel.kt: Transformations.map has moved from a static call to
  an extension function on LiveData.

After this commit the app builds/runs.
With targetSdk 36 (Flutter 3.47's default), Android 15+ draws the app
edge to edge, under the status bar. Flutter's AppBar insets itself for
the status bar, but the native AppBarLayout didn't, so it sat a status
bar's height higher. The opaque native page covered Flutter's tab bar,
and touches on the native tabs missed Flutter's tabs underneath.
@pjkammer pjkammer changed the title [tabs_overlay] Update SDK constraint, dependencies, and lints [tabs_overlay] Update to Flutter 3.47 and fix the Android build Oct 15, 2026
@pjkammer
pjkammer marked this pull request as ready for review October 20, 2026 18:47
@pjkammer pjkammer mentioned this pull request Oct 20, 2026
6 of 8 tasks
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.

1 participant