Skip to content

[scroll_overlay] Update to Flutter 3.47 and fix the Android build - #242

Merged
pjkammer merged 6 commits into
flutter:mainfrom
pjkammer:scroll-overlay-update
Oct 28, 2026
Merged

pjkammer merged 6 commits into
flutter:mainfrom
pjkammer:scroll-overlay-update

Conversation

@pjkammer

@pjkammer pjkammer commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Brings scroll_overlay up to date with Flutter 3.47, still on package:flutter/material.dart, in preparation for migrating to the material_ui package. This updates and cleans up the flutter config, fixes the broken Android build, and checks in automated iOS migrations.

Commits:

  1. Rename analysis_option.yaml to analysis_options.yaml, on its own, so the next commit shows as edits to it.
  2. Dependencies and lints. Updated analysis_options.yaml to the current flutter created config. Updated pubspec.yaml with SDK version ^3.13.0 (material_ui's minimum), flutter_lints: ^6.0.0, and explicit flutter_test dependency. Added publish_to: 'none', as in other apps, and version: 1.0.0+1 to remove the "Missing build name" and "Missing build number" warnings from iOS builds. Then flutter pub upgrade.
  3. Analyzer fixes. dart fix for two lints, and a manual fix to have createState() return State<FlutterDemo>.
  4. dart format.
  5. Flutter's automatic iOS project migrations, from flutter build ios --simulator --debug, unmodified.
  6. Recreated Android project with flutter create, keeping the app's own Java code, layouts and android/README.md. Two small hand edits: the manifest launches ScrollOverlayActivity, the app's entry point, instead of the template's MainActivity, and RecyclerView dependency is declared at 1.2.0, maintaining the version the old project used.

Tested with Flutter 3.47.7: flutter analyze, flutter test and dart format are clean. iOS and Android builds don't modify any tracked files. On a Pixel 10 Pro emulator (Android 17), the integration test passes and the app runs in light and dark mode, with the native and Flutter rows lined up. On an iPhone 17 Pro simulator (iOS 26.4), the app runs, and the recordings below replay the same scripted fling on main and with this PR. Where an injected fling ends varies from run to run.

iOS

BeforeAfter
scroll_overlay_before.mp4
scroll_overlay_after.mp4

Android

Android build was broken before this, so there's only an after version:

android_before.mp4

Unchanged issues/inconsistencies:

  • On iOS, the two lists drift apart during a fling: Flutter's rows trail the native rows mid-fling and come to rest up to about half a row farther. Both recordings show it.
  • On iOS, the velocity panel's Platform number is off: it's divided by the screen's pixel ratio (a third on a 3x iPhone), its sign is flipped so Difference shows the sum and Ratio goes negative, and it stops updating when the finger lifts.
  • The integration test fails on iOS: the fling stops at item 62, and the test expects at least 70.

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 lint fixes and formatting, and the native project changes were checked by hand on both platforms (above).
  • All existing and new tests are passing.
    Locally, flutter test passes, and the integration test passes on Android. On iOS the integration test fails in the same way it did previously.

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

The file was added in 2019 without the "s". Renamed on its own so
that the next commit's changes to it show up as edits.
1. Replaced the contents of analysis_options.yaml, a 2019 copy of
   flutter/flutter's options, with the file `flutter create` writes
   (Flutter 3.47.7).
2. Hand edits to pubspec.yaml:
   - Raise SDK constraint to ^3.13.0 to match material_ui.
   - Add flutter_lints ^6.0.0.
   - Add flutter_test, which the tests import but which only resolved
     through integration_test.
   - Add publish_to: 'none' and version: 1.0.0+1. The version silences
     the "Missing build name" and "Missing build number" warnings in
     iOS builds.
   The comments for the new lines are copied from the template.
3. flutter pub upgrade
`flutter analyze` reported 3 issues.

1. `dart fix --apply` fixed 2: curly_braces_in_flow_control_structures,
   prefer_adjacent_string_concatenation. It joins the three debugPrint
   string literals onto one line (the next commit wraps them).
2. Hand edit for library_private_types_in_public_api: createState()
   returns State<FlutterDemo>.
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:
```
Building com.yourcompany.scrollOverlay for simulator (ios)...
Upgrading project.pbxproj
Legacy build system detected, removing .../scroll_overlay/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
Project base configurations detected, removing.
Upgrading contents.xcworkspacedata
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.
Adding Swift Package Manager integration...                         3.1s
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.                                           16.0s
✓ Built build/ios/iphonesimulator/Runner.app
```
The old project (Gradle 6.7.1, AGP 4.2.2, `apply from: flutter.gradle`)
no longer builds with current Flutter.

Steps, run from the scroll_overlay directory:
1. rm -rf android
2. flutter create --platforms=android --org io.flutter \
        --project-name scroll_overlay -a java .
   # --org and -a java keep the app's package name
   # (io.flutter.scroll_overlay) and language (Java)
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, layouts and README
5. git restore android/README.md \
               android/app/src/main/java \
               android/app/src/main/res/layout

   # Drop the template's activity (the app has ScrollOverlayActivity)
6. rm android/app/src/main/java/io/flutter/scroll_overlay/MainActivity.java

Then hand edits to make the native side build and run:

- AndroidManifest.xml: launch ScrollOverlayActivity, not the template's
  MainActivity.
- android/app/build.gradle.kts: add the RecyclerView dependency the old
  project declared, at the end of the file. It stays at 1.2.0 rather
  than risk changing the native list that the app compares Flutter's
  scrolling against. kotlin-stdlib-jdk7 isn't carried over: the app has
  no Kotlin code.
@pjkammer
pjkammer marked this pull request as ready for review October 28, 2026 00:26
@pjkammer pjkammer mentioned this pull request Oct 28, 2026
5 of 8 tasks
@pjkammer
pjkammer requested a review from Piinks October 28, 2026 18:30

@Piinks Piinks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! LGTM!

@pjkammer
pjkammer merged commit 4fe72ab into flutter:main Oct 28, 2026
7 checks passed
@pjkammer
pjkammer deleted the scroll-overlay-update branch October 28, 2026 22:09
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.

2 participants