chore(example): modernize example app to the current Flutter template#15
Open
freakness wants to merge 1 commit into
Open
chore(example): modernize example app to the current Flutter template#15freakness wants to merge 1 commit into
freakness wants to merge 1 commit into
Conversation
The package is pure Dart (no native plugin code), so the built-in Kotlin and Swift Package Manager plugin-author migrations don't apply to it. The example app, however, was on an ancient template (Gradle 5.4.1, AGP 3.5.2, jcenter, .flutter-plugins settings.gradle, Java MainActivity, Obj-C iOS). Regenerated example/android and example/ios from the current Flutter template (preserving the demo lib/ and pubspec): - Android: declarative settings.gradle.kts plugins block (built-in Kotlin), *.gradle.kts, Kotlin MainActivity, Gradle 8.14 / AGP 8.11.1 / Kotlin 2.2.20. - iOS: Swift AppDelegate, RunnerTests target, SPM-ready, modern xcschemes. - Bumped example Dart SDK to >=3.0.0 <4.0.0, added flutter_lints, modernized .gitignore, replaced dead widget_test.dart with a smoke test. Verified: flutter build apk --debug and flutter build ios --no-codesign both succeed; example smoke test and the package's 38 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Modernizes the example app scaffolding to match the current Flutter app template (Android built-in Kotlin + modern iOS Swift/SPM-ready layout), while keeping the package itself unchanged (pure Dart).
Changes:
- Regenerated example Android project structure to Kotlin/Gradle Kotlin DSL and updated Gradle/AGP/Kotlin versions.
- Regenerated example iOS project to Swift (
AppDelegate.swift), added a basic unit test target, and updated Xcode workspace/scheme settings. - Updated the example’s Dart SDK constraint to Dart 3, added
flutter_lints, and replaced the commented widget test with a real smoke test.
Reviewed changes
Copilot reviewed 40 out of 56 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| example/test/widget_test.dart | Replaces commented template test with a basic smoke test that pumps the example app. |
| example/pubspec.yaml | Bumps example Dart SDK constraint to Dart 3 and adds flutter_lints. |
| example/pubspec.lock | Updates locked dependencies for Dart 3 + flutter_lints. |
| example/ios/RunnerTests/RunnerTests.swift | Adds a Swift XCTest target scaffold. |
| example/ios/Runner/Runner-Bridging-Header.h | Adds bridging header for GeneratedPluginRegistrant. |
| example/ios/Runner/main.m | Removes Obj-C main.m entrypoint (migrating to Swift @main). |
| example/ios/Runner/Info.plist | Updates iOS app plist defaults (language/display name/status bar key changes). |
| example/ios/Runner/AppDelegate.swift | Adds Swift AppDelegate and registers plugins. |
| example/ios/Runner/AppDelegate.m | Removes legacy Obj-C AppDelegate implementation. |
| example/ios/Runner/AppDelegate.h | Removes legacy Obj-C AppDelegate header. |
| example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | Adds modern workspace settings file. |
| example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | Adds Xcode workspace checks plist. |
| example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | Updates scheme (adds testable and switches Profile action config). |
| example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | Adds modern project-workspace settings file. |
| example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | Adds Xcode project-workspace checks plist. |
| example/ios/Runner.xcodeproj/project.pbxproj | Updates Xcode project for Swift + tests target + modern build settings. |
| example/ios/Flutter/Flutter.podspec | Removes legacy local Flutter podspec file. |
| example/ios/Flutter/.last_build_id | Removes last build ID artifact. |
| example/ios/.gitignore | Modernizes iOS ignore rules for Flutter/Xcode outputs. |
| example/android/settings.gradle.kts | Adds Kotlin DSL settings with Flutter plugin loader and pluginManagement. |
| example/android/settings.gradle | Removes legacy .flutter-plugins-based settings.gradle. |
| example/android/gradle/wrapper/gradle-wrapper.properties | Updates Gradle wrapper distribution to Gradle 8.14. |
| example/android/gradle.properties | Updates Gradle properties and JVM args for modern Android builds. |
| example/android/build.gradle.kts | Adds Kotlin DSL root build setup and clean task. |
| example/android/build.gradle | Removes legacy Groovy buildscript/jcenter() config. |
| example/android/app/src/profile/AndroidManifest.xml | Adds profile manifest with INTERNET permission (modern template split). |
| example/android/app/src/main/res/values/styles.xml | Updates light-mode launch/normal themes to modern template. |
| example/android/app/src/main/res/values-night/styles.xml | Adds night-mode theme resources for modern template behavior. |
| example/android/app/src/main/res/drawable-v21/launch_background.xml | Adds modern splash background layer-list resource. |
| example/android/app/src/main/kotlin/com/realank/example/MainActivity.kt | Replaces Java MainActivity with Kotlin MainActivity. |
| example/android/app/src/main/java/com/realank/example/MainActivity.java | Removes legacy Java MainActivity. |
| example/android/app/src/main/AndroidManifest.xml | Updates manifest to embedding v2 template (exported, queries, placeholders, etc.). |
| example/android/app/src/debug/AndroidManifest.xml | Adds debug manifest with INTERNET permission (modern template split). |
| example/android/app/build.gradle.kts | Adds Kotlin DSL app module build with Flutter Gradle plugin. |
| example/android/app/build.gradle | Removes legacy Groovy app build.gradle. |
| example/android/.settings/org.eclipse.buildship.core.prefs | Removes legacy Eclipse/Buildship project settings. |
| example/android/.project | Removes legacy Eclipse project file. |
| example/android/.gitignore | Updates Android ignore rules. |
| example/analysis_options.yaml | Adds analyzer config including flutter_lints. |
| example/.metadata | Updates Flutter project metadata to stable channel and modern migrate tracking. |
| example/.gitignore | Modernizes example-level .gitignore for Flutter tooling outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5
to
+7
| file("local.properties").inputStream().use { properties.load(it) } | ||
| val flutterSdkPath = properties.getProperty("flutter.sdk") | ||
| require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } |
Comment on lines
+1
to
+5
| gradle-wrapper.jar | ||
| /.gradle | ||
| /captures/ | ||
| /gradlew | ||
| /gradlew.bat |
| @@ -1,4 +1,2 @@ | |||
| org.gradle.jvmargs=-Xmx1536M | |||
| android.enableR8=true | |||
| org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError | |||
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| CLANG_ENABLE_MODULES = YES; | ||
| CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| DEVELOPMENT_TEAM = 3LTAY2799H; |
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| CLANG_ENABLE_MODULES = YES; | ||
| CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| DEVELOPMENT_TEAM = 3LTAY2799H; |
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| CLANG_ENABLE_MODULES = YES; | ||
| CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| DEVELOPMENT_TEAM = 3LTAY2799H; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
This repo was flagged for the same "new Flutter world" migration we did in Team-Picky/picky-app#126 (built-in Kotlin + Swift Package Manager).
Key finding:
flutter_datetime_picker_plusis a pure Dart package — noflutter.pluginsection, no native Android/iOS code. The built-in Kotlin and SPM migrations are plugin-author requirements that only apply to packages shipping native code, so the package itself needs no migration.The only thing on the old template was the example app, which was ancient: Gradle 5.4.1, AGP 3.5.2, dead
jcenter(),.flutter-plugins-basedsettings.gradle, a JavaMainActivity, and an Objective-C iOS app. This PR regenerates its platform folders from the current Flutter template (3.38.5, per.fvmrc), preserving the demolib/and pubspec.Refs the docs:
Changes (example app only)
Android — built-in Kotlin
settings.gradle.ktswithpluginManagement+plugins {}block (Flutter applies the Kotlin Gradle plugin itself).build.gradle.kts+app/build.gradle.kts, KotlinMainActivity.kt.namespaceset;minSdk/targetSdk/compileSdkdriven by Flutter.iOS — Swift / SPM-ready
AppDelegate.swift+Runner-Bridging-Header.h(replaces Obj-CAppDelegate.m/main.m).RunnerTests/Swift unit-test target and modern xcscheme/workspace settings.flutter config --enable-swift-package-manager) is a no-op here — there's noPackage.swiftto migrate.Incidental
>=2.12.0 <3.0.0→>=3.0.0 <4.0.0.flutter_lints; modernized example.gitignore; replaced the dead commented-outwidget_test.dartwith a real smoke test.Verification
flutter build apk --debug→ builtapp-debug.apk(proves the Gradle / built-in-Kotlin migration compiles).flutter build ios --debug --no-codesign→ builtRunner.app.flutter analyzeclean except pre-existingprint/string-interpolation infos in the demo code.Notes / out of scope
🤖 Generated with Claude Code