Skip to content

chore(example): modernize example app to the current Flutter template#15

Open
freakness wants to merge 1 commit into
masterfrom
chore/modernize-example-app
Open

chore(example): modernize example app to the current Flutter template#15
freakness wants to merge 1 commit into
masterfrom
chore/modernize-example-app

Conversation

@freakness

Copy link
Copy Markdown
Collaborator

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_plus is a pure Dart package — no flutter.plugin section, 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-based settings.gradle, a Java MainActivity, and an Objective-C iOS app. This PR regenerates its platform folders from the current Flutter template (3.38.5, per .fvmrc), preserving the demo lib/ and pubspec.

Refs the docs:

Changes (example app only)

Android — built-in Kotlin

  • Declarative settings.gradle.kts with pluginManagement + plugins {} block (Flutter applies the Kotlin Gradle plugin itself).
  • build.gradle.kts + app/build.gradle.kts, Kotlin MainActivity.kt.
  • Gradle 8.14 / AGP 8.11.1 / Kotlin 2.2.20; namespace set; minSdk/targetSdk/compileSdk driven by Flutter.

iOS — Swift / SPM-ready

  • Swift AppDelegate.swift + Runner-Bridging-Header.h (replaces Obj-C AppDelegate.m/main.m).
  • Added RunnerTests/ Swift unit-test target and modern xcscheme/workspace settings.
  • SPM-compatible template. Since the package ships no native iOS dependency, enabling SPM (flutter config --enable-swift-package-manager) is a no-op here — there's no Package.swift to migrate.

Incidental

  • Example Dart SDK constraint >=2.12.0 <3.0.0>=3.0.0 <4.0.0.
  • Added flutter_lints; modernized example .gitignore; replaced the dead commented-out widget_test.dart with a real smoke test.

Verification

  • flutter build apk --debug → built app-debug.apk (proves the Gradle / built-in-Kotlin migration compiles).
  • flutter build ios --debug --no-codesign → built Runner.app.
  • ✅ Example smoke test passes; the package's own 38 tests pass; flutter analyze clean except pre-existing print/string-interpolation infos in the demo code.

Notes / out of scope

  • No library code changed → no version bump (stays 2.4.0).

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 19, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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;
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