From 0c8546d4a195dd4bcb2544ee5348880485f68bee Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Mon, 3 Aug 2026 13:30:29 -0500 Subject: [PATCH 1/3] Update samples and templates to Flutter 3.44 --- samples/ads/.metadata | 14 +- samples/ads/analysis_options.yaml | 8 + samples/ads/android/app/build.gradle.kts | 19 +- samples/ads/android/build.gradle.kts | 5 +- samples/ads/android/gradle.properties | 5 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- samples/ads/android/settings.gradle.kts | 19 +- samples/ads/codelab_rebuild.yaml | 16 +- .../ads/ios/Flutter/AppFrameworkInfo.plist | 2 - samples/ads/ios/Flutter/Debug.xcconfig | 1 - samples/ads/ios/Flutter/Release.xcconfig | 1 - samples/ads/ios/Podfile | 43 --- .../ads/ios/Runner.xcodeproj/project.pbxproj | 164 +++--------- .../xcshareddata/swiftpm/Package.resolved | 23 ++ .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ .../contents.xcworkspacedata | 3 - .../xcshareddata/swiftpm/Package.resolved | 23 ++ samples/ads/ios/Runner/AppDelegate.swift | 7 +- samples/ads/ios/Runner/Info.plist | 37 ++- samples/ads/ios/Runner/SceneDelegate.swift | 6 + samples/ads/lib/ads/my_banner_ad.dart | 5 +- .../ads/lib/app_lifecycle/app_lifecycle.dart | 5 +- samples/ads/lib/audio/audio_controller.dart | 46 ++-- samples/ads/lib/audio/sounds.dart | 37 +-- samples/ads/lib/game_internals/score.dart | 9 +- .../level_selection_screen.dart | 16 +- samples/ads/lib/level_selection/levels.dart | 14 +- samples/ads/lib/main.dart | 66 ++--- .../lib/play_session/play_session_screen.dart | 10 +- .../lib/player_progress/player_progress.dart | 2 +- samples/ads/lib/router.dart | 98 +++---- .../ads/lib/settings/custom_name_dialog.dart | 7 +- samples/ads/lib/settings/settings.dart | 2 +- samples/ads/lib/settings/settings_screen.dart | 19 +- samples/ads/lib/style/confetti.dart | 39 ++- samples/ads/lib/style/my_button.dart | 5 +- samples/ads/lib/style/my_transition.dart | 15 +- samples/ads/lib/style/responsive_screen.dart | 16 +- samples/ads/lib/win_game/win_game_screen.dart | 9 +- samples/ads/pubspec.yaml | 18 +- samples/crossword/analysis_options.yaml | 10 +- samples/crossword/lib/model.g.dart | 242 +++++------------ samples/crossword/lib/providers.dart | 1 - samples/crossword/lib/providers.g.dart | 245 +++++++++++++----- samples/crossword/pubspec.yaml | 24 +- samples/multiplayer/.metadata | 26 +- samples/multiplayer/analysis_options.yaml | 8 + .../multiplayer/android/app/build.gradle.kts | 15 +- samples/multiplayer/android/build.gradle.kts | 5 +- samples/multiplayer/android/gradle.properties | 5 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../multiplayer/android/settings.gradle.kts | 21 +- samples/multiplayer/codelab_rebuild.yaml | 38 +-- .../ios/Flutter/AppFrameworkInfo.plist | 2 - .../multiplayer/ios/Flutter/Debug.xcconfig | 1 - .../multiplayer/ios/Flutter/Release.xcconfig | 1 - samples/multiplayer/ios/Podfile | 42 --- .../ios/Runner.xcodeproj/project.pbxproj | 42 ++- .../xcshareddata/swiftpm/Package.resolved | 122 +++++++++ .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ .../xcshareddata/swiftpm/Package.resolved | 122 +++++++++ .../multiplayer/ios/Runner/AppDelegate.swift | 7 +- samples/multiplayer/ios/Runner/Info.plist | 29 ++- .../ios/Runner/SceneDelegate.swift | 6 + samples/multiplayer/lib/style/confetti.dart | 3 +- .../linux/flutter/generated_plugins.cmake | 1 + .../linux/runner/my_application.cc | 42 ++- .../multiplayer/linux/runner/my_application.h | 5 +- .../macos/Flutter/Flutter-Debug.xcconfig | 1 - .../macos/Flutter/Flutter-Release.xcconfig | 1 - .../Flutter/GeneratedPluginRegistrant.swift | 2 - samples/multiplayer/macos/Podfile | 42 --- .../macos/Runner.xcodeproj/project.pbxproj | 40 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ .../macos/Runner/Configs/AppInfo.xcconfig | 2 +- samples/multiplayer/pubspec.yaml | 20 +- samples/multiplayer/web/index.html | 8 + templates/basic/.metadata | 30 +-- templates/basic/analysis_options.yaml | 8 + templates/basic/android/app/build.gradle.kts | 15 +- templates/basic/android/build.gradle.kts | 5 +- templates/basic/android/gradle.properties | 5 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- templates/basic/android/settings.gradle.kts | 19 +- templates/basic/codelab_rebuild.yaml | 16 +- .../basic/ios/Flutter/AppFrameworkInfo.plist | 2 - templates/basic/ios/Flutter/Debug.xcconfig | 1 - templates/basic/ios/Flutter/Release.xcconfig | 1 - templates/basic/ios/Podfile | 43 --- .../ios/Runner.xcodeproj/project.pbxproj | 34 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ templates/basic/ios/Runner/AppDelegate.swift | 7 +- templates/basic/ios/Runner/Info.plist | 33 ++- .../basic/ios/Runner/SceneDelegate.swift | 6 + templates/basic/lib/style/confetti.dart | 3 +- .../linux/flutter/generated_plugins.cmake | 1 + .../basic/linux/runner/my_application.cc | 42 ++- templates/basic/linux/runner/my_application.h | 5 +- .../macos/Flutter/Flutter-Debug.xcconfig | 1 - .../macos/Flutter/Flutter-Release.xcconfig | 1 - .../Flutter/GeneratedPluginRegistrant.swift | 2 - templates/basic/macos/Podfile | 42 --- .../macos/Runner.xcodeproj/project.pbxproj | 30 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ .../macos/Runner/Configs/AppInfo.xcconfig | 2 +- templates/basic/pubspec.yaml | 16 +- templates/basic/web/index.html | 8 + .../windows/flutter/generated_plugins.cmake | 1 + templates/basic/windows/runner/Runner.rc | 2 +- templates/basic/windows/runner/utils.cpp | 14 +- templates/card/.metadata | 30 +-- templates/card/analysis_options.yaml | 8 + templates/card/android/app/build.gradle.kts | 15 +- templates/card/android/build.gradle.kts | 5 +- templates/card/android/gradle.properties | 5 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- templates/card/android/settings.gradle.kts | 19 +- templates/card/codelab_rebuild.yaml | 14 + .../card/ios/Flutter/AppFrameworkInfo.plist | 2 - templates/card/ios/Flutter/Debug.xcconfig | 1 - templates/card/ios/Flutter/Release.xcconfig | 1 - templates/card/ios/Podfile | 43 --- .../card/ios/Runner.xcodeproj/project.pbxproj | 34 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ templates/card/ios/Runner/AppDelegate.swift | 7 +- templates/card/ios/Runner/Info.plist | 33 ++- templates/card/ios/Runner/SceneDelegate.swift | 6 + templates/card/lib/style/confetti.dart | 3 +- .../linux/flutter/generated_plugins.cmake | 1 + templates/card/linux/runner/my_application.cc | 42 ++- templates/card/linux/runner/my_application.h | 5 +- .../card/macos/Flutter/Flutter-Debug.xcconfig | 1 - .../macos/Flutter/Flutter-Release.xcconfig | 1 - .../Flutter/GeneratedPluginRegistrant.swift | 2 - templates/card/macos/Podfile | 42 --- .../macos/Runner.xcodeproj/project.pbxproj | 30 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ .../macos/Runner/Configs/AppInfo.xcconfig | 2 +- templates/card/pubspec.yaml | 16 +- templates/card/web/index.html | 8 + .../windows/flutter/generated_plugins.cmake | 1 + templates/card/windows/runner/Runner.rc | 2 +- templates/card/windows/runner/utils.cpp | 14 +- .../endless_runner/analysis_options.yaml | 8 + .../android/app/build.gradle.kts | 15 +- .../endless_runner/android/build.gradle.kts | 5 +- .../endless_runner/android/gradle.properties | 5 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../android/settings.gradle.kts | 19 +- templates/endless_runner/codelab_rebuild.yaml | 15 +- .../ios/Flutter/AppFrameworkInfo.plist | 2 - .../endless_runner/ios/Flutter/Debug.xcconfig | 1 - .../ios/Flutter/Release.xcconfig | 1 - templates/endless_runner/ios/Podfile | 43 --- .../ios/Runner.xcodeproj/project.pbxproj | 34 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ .../ios/Runner/AppDelegate.swift | 7 +- .../endless_runner/ios/Runner/Info.plist | 33 ++- .../ios/Runner/SceneDelegate.swift | 6 + .../linux/flutter/generated_plugins.cmake | 1 + .../linux/runner/my_application.cc | 42 ++- .../linux/runner/my_application.h | 5 +- .../macos/Flutter/Flutter-Debug.xcconfig | 1 - .../macos/Flutter/Flutter-Release.xcconfig | 1 - .../Flutter/GeneratedPluginRegistrant.swift | 2 - templates/endless_runner/macos/Podfile | 42 --- .../macos/Runner.xcodeproj/project.pbxproj | 30 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++ .../macos/Runner/Configs/AppInfo.xcconfig | 2 +- templates/endless_runner/pubspec.yaml | 24 +- templates/endless_runner/web/index.html | 8 + .../windows/flutter/generated_plugins.cmake | 1 + .../endless_runner/windows/runner/Runner.rc | 2 +- .../endless_runner/windows/runner/utils.cpp | 14 +- 174 files changed, 1944 insertions(+), 1400 deletions(-) delete mode 100644 samples/ads/ios/Podfile create mode 100644 samples/ads/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 samples/ads/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 samples/ads/ios/Runner/SceneDelegate.swift delete mode 100644 samples/multiplayer/ios/Podfile create mode 100644 samples/multiplayer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 samples/multiplayer/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 samples/multiplayer/ios/Runner/SceneDelegate.swift delete mode 100644 samples/multiplayer/macos/Podfile delete mode 100644 templates/basic/ios/Podfile create mode 100644 templates/basic/ios/Runner/SceneDelegate.swift delete mode 100644 templates/basic/macos/Podfile delete mode 100644 templates/card/ios/Podfile create mode 100644 templates/card/ios/Runner/SceneDelegate.swift delete mode 100644 templates/card/macos/Podfile delete mode 100644 templates/endless_runner/ios/Podfile create mode 100644 templates/endless_runner/ios/Runner/SceneDelegate.swift delete mode 100644 templates/endless_runner/macos/Podfile diff --git a/samples/ads/.metadata b/samples/ads/.metadata index 9876868f..3a289968 100644 --- a/samples/ads/.metadata +++ b/samples/ads/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "6fba2447e95c451518584c35e25f5433f14d888c" + revision: "058e0af2c2b57e369d905a03ac9748b0ebf543c6" channel: "stable" project_type: app @@ -13,14 +13,14 @@ project_type: app migration: platforms: - platform: root - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: android - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: ios - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 # User provided section diff --git a/samples/ads/analysis_options.yaml b/samples/ads/analysis_options.yaml index 01ceeb04..ca32b516 100644 --- a/samples/ads/analysis_options.yaml +++ b/samples/ads/analysis_options.yaml @@ -1,6 +1,14 @@ include: package:flutter_lints/flutter.yaml analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** language: strict-casts: true diff --git a/samples/ads/android/app/build.gradle.kts b/samples/ads/android/app/build.gradle.kts index a2de9467..89cbb112 100644 --- a/samples/ads/android/app/build.gradle.kts +++ b/samples/ads/android/app/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id("com.android.application") - id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } @@ -8,15 +7,11 @@ plugins { android { namespace = "com.example.basic" compileSdk = flutter.compileSdkVersion - ndkVersion = "27.0.12077973" + ndkVersion = "28.2.13676358" compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { @@ -24,7 +19,7 @@ android { applicationId = "com.example.basic" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. - minSdk = 23 + minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName @@ -39,6 +34,12 @@ android { } } +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + flutter { source = "../.." } diff --git a/samples/ads/android/build.gradle.kts b/samples/ads/android/build.gradle.kts index 89176ef4..dbee657b 100644 --- a/samples/ads/android/build.gradle.kts +++ b/samples/ads/android/build.gradle.kts @@ -5,7 +5,10 @@ allprojects { } } -val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() rootProject.layout.buildDirectory.value(newBuildDir) subprojects { diff --git a/samples/ads/android/gradle.properties b/samples/ads/android/gradle.properties index f018a618..e96108cf 100644 --- a/samples/ads/android/gradle.properties +++ b/samples/ads/android/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/samples/ads/android/gradle/wrapper/gradle-wrapper.properties b/samples/ads/android/gradle/wrapper/gradle-wrapper.properties index ac3b4792..2d428bfb 100644 --- a/samples/ads/android/gradle/wrapper/gradle-wrapper.properties +++ b/samples/ads/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip diff --git a/samples/ads/android/settings.gradle.kts b/samples/ads/android/settings.gradle.kts index ab39a10a..c21f0c5b 100644 --- a/samples/ads/android/settings.gradle.kts +++ b/samples/ads/android/settings.gradle.kts @@ -1,11 +1,12 @@ pluginManagement { - val flutterSdkPath = run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") @@ -18,8 +19,8 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.3" apply false - id("org.jetbrains.kotlin.android") version "2.1.0" apply false + id("com.android.application") version "9.0.1" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false } include(":app") diff --git a/samples/ads/codelab_rebuild.yaml b/samples/ads/codelab_rebuild.yaml index 59e4b77c..29eea39f 100644 --- a/samples/ads/codelab_rebuild.yaml +++ b/samples/ads/codelab_rebuild.yaml @@ -7,6 +7,20 @@ steps: - ios - name: Flutter recreate flutter: create --org com.example --project-name basic --platforms ios,android . + - name: Set minimum iOS deployment target + path: ios/Runner.xcodeproj/project.pbxproj + patch-u: | + --- a/ios/Runner.xcodeproj/project.pbxproj + +++ b/ios/Runner.xcodeproj/project.pbxproj + @@ -363,1 +363,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -490,1 +490,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -541,1 +541,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; - name: Remove test/widget_test.dart rm: test/widget_test.dart - name: Patch android/app/build.gradle.kts @@ -19,7 +33,7 @@ steps: namespace = "com.example.basic" compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion - + ndkVersion = "27.0.12077973" + + ndkVersion = "28.2.13676358" compileOptions { sourceCompatibility = JavaVersion.VERSION_11 diff --git a/samples/ads/ios/Flutter/AppFrameworkInfo.plist b/samples/ads/ios/Flutter/AppFrameworkInfo.plist index 7c569640..391a902b 100644 --- a/samples/ads/ios/Flutter/AppFrameworkInfo.plist +++ b/samples/ads/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/samples/ads/ios/Flutter/Debug.xcconfig b/samples/ads/ios/Flutter/Debug.xcconfig index ec97fc6f..592ceee8 100644 --- a/samples/ads/ios/Flutter/Debug.xcconfig +++ b/samples/ads/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/samples/ads/ios/Flutter/Release.xcconfig b/samples/ads/ios/Flutter/Release.xcconfig index c4855bfe..592ceee8 100644 --- a/samples/ads/ios/Flutter/Release.xcconfig +++ b/samples/ads/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/samples/ads/ios/Podfile b/samples/ads/ios/Podfile deleted file mode 100644 index e549ee22..00000000 --- a/samples/ads/ios/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/samples/ads/ios/Runner.xcodeproj/project.pbxproj b/samples/ads/ios/Runner.xcodeproj/project.pbxproj index deb36d43..dd3268c6 100644 --- a/samples/ads/ios/Runner.xcodeproj/project.pbxproj +++ b/samples/ads/ios/Runner.xcodeproj/project.pbxproj @@ -11,11 +11,11 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 92BBC9806994A6448FE39E37 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D167396435DBB44E909222D /* Pods_RunnerTests.framework */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - ABB4A3DF436F2A32C18182D1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A185194C7D520F155BBD965F /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -47,10 +47,10 @@ 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3D167396435DBB44E909222D /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 47D30307D1A17E8ED734960C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -59,28 +59,14 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A185194C7D520F155BBD965F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - DB546ACDCB424691A8DDD4D3 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - E1EA53AFC2D163F89257E391 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - E9D5A8EAC40072F6D1431C98 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - EEEB392F82C7779067ECDB3F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - FB29C2129E7678734F88A455 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 359B9FA0F830426C389776EC /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 92BBC9806994A6448FE39E37 /* Pods_RunnerTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - ABB4A3DF436F2A32C18182D1 /* Pods_Runner.framework in Frameworks */, + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -98,6 +84,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -113,8 +100,6 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, - C93CD60C0DBAA633781CAE26 /* Pods */, - CF4A630DF7E934AA301C1809 /* Frameworks */, ); sourceTree = ""; }; @@ -137,34 +122,12 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; - C93CD60C0DBAA633781CAE26 /* Pods */ = { - isa = PBXGroup; - children = ( - E1EA53AFC2D163F89257E391 /* Pods-Runner.debug.xcconfig */, - EEEB392F82C7779067ECDB3F /* Pods-Runner.release.xcconfig */, - 47D30307D1A17E8ED734960C /* Pods-Runner.profile.xcconfig */, - FB29C2129E7678734F88A455 /* Pods-RunnerTests.debug.xcconfig */, - E9D5A8EAC40072F6D1431C98 /* Pods-RunnerTests.release.xcconfig */, - DB546ACDCB424691A8DDD4D3 /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - CF4A630DF7E934AA301C1809 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A185194C7D520F155BBD965F /* Pods_Runner.framework */, - 3D167396435DBB44E909222D /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -172,10 +135,8 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 1C53FE7AB5229FD2BC8BC9B0 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, - 359B9FA0F830426C389776EC /* Frameworks */, ); buildRules = ( ); @@ -191,21 +152,21 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - F126FB36FBB82EA11225070D /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - A2CC5FD621A6676DD9F9E9AF /* [CP] Embed Pods Frameworks */, - 1CE2CDC511A7A1391A5A5AA5 /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -239,6 +200,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -271,45 +235,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1C53FE7AB5229FD2BC8BC9B0 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 1CE2CDC511A7A1391A5A5AA5 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -341,45 +266,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - A2CC5FD621A6676DD9F9E9AF /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - F126FB36FBB82EA11225070D /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -397,6 +283,7 @@ files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -473,7 +360,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -505,7 +392,6 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FB29C2129E7678734F88A455 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -523,7 +409,6 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E9D5A8EAC40072F6D1431C98 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -539,7 +424,6 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DB546ACDCB424691A8DDD4D3 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -602,7 +486,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -653,7 +537,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -741,6 +625,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/samples/ads/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/ads/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..f3811934 --- /dev/null +++ b/samples/ads/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,23 @@ +{ + "pins" : [ + { + "identity" : "swift-package-manager-google-mobile-ads", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googleads/swift-package-manager-google-mobile-ads", + "state" : { + "revision" : "868149fc50d1452078e83540e636cf519bac3e6a", + "version" : "13.7.0" + } + }, + { + "identity" : "swift-package-manager-google-user-messaging-platform", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googleads/swift-package-manager-google-user-messaging-platform.git", + "state" : { + "revision" : "13b248eaa73b7826f0efb1bcf455e251d65ecb1b", + "version" : "3.1.0" + } + } + ], + "version" : 2 +} diff --git a/samples/ads/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/samples/ads/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e3773d42..c3fedb29 100644 --- a/samples/ads/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/samples/ads/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + - - diff --git a/samples/ads/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/ads/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..f3811934 --- /dev/null +++ b/samples/ads/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,23 @@ +{ + "pins" : [ + { + "identity" : "swift-package-manager-google-mobile-ads", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googleads/swift-package-manager-google-mobile-ads", + "state" : { + "revision" : "868149fc50d1452078e83540e636cf519bac3e6a", + "version" : "13.7.0" + } + }, + { + "identity" : "swift-package-manager-google-user-messaging-platform", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googleads/swift-package-manager-google-user-messaging-platform.git", + "state" : { + "revision" : "13b248eaa73b7826f0efb1bcf455e251d65ecb1b", + "version" : "3.1.0" + } + } + ], + "version" : 2 +} diff --git a/samples/ads/ios/Runner/AppDelegate.swift b/samples/ads/ios/Runner/AppDelegate.swift index 62666446..c30b367e 100644 --- a/samples/ads/ios/Runner/AppDelegate.swift +++ b/samples/ads/ios/Runner/AppDelegate.swift @@ -2,12 +2,15 @@ import Flutter import UIKit @main -@objc class AppDelegate: FlutterAppDelegate { +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/samples/ads/ios/Runner/Info.plist b/samples/ads/ios/Runner/Info.plist index 31aeeba1..d0190ac8 100644 --- a/samples/ads/ios/Runner/Info.plist +++ b/samples/ads/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,33 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + + + GADApplicationIdentifier + ca-app-pub-3940256099942544~3347511713 UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,13 +70,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - - - GADApplicationIdentifier - ca-app-pub-3940256099942544~3347511713 diff --git a/samples/ads/ios/Runner/SceneDelegate.swift b/samples/ads/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/samples/ads/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/samples/ads/lib/ads/my_banner_ad.dart b/samples/ads/lib/ads/my_banner_ad.dart index 014e822b..8553c48c 100644 --- a/samples/ads/lib/ads/my_banner_ad.dart +++ b/samples/ads/lib/ads/my_banner_ad.dart @@ -16,10 +16,7 @@ class MyBannerAdWidget extends StatefulWidget { // ... or this one on iOS. : 'ca-app-pub-3940256099942544/2934735716'; - MyBannerAdWidget({ - super.key, - this.adSize = AdSize.banner, - }); + MyBannerAdWidget({super.key, this.adSize = AdSize.banner}); @override State createState() => _MyBannerAdWidgetState(); diff --git a/samples/ads/lib/app_lifecycle/app_lifecycle.dart b/samples/ads/lib/app_lifecycle/app_lifecycle.dart index 8e2b57c5..e3d6533f 100644 --- a/samples/ads/lib/app_lifecycle/app_lifecycle.dart +++ b/samples/ads/lib/app_lifecycle/app_lifecycle.dart @@ -21,8 +21,9 @@ class _AppLifecycleObserverState extends State { static final _log = Logger('AppLifecycleObserver'); late final AppLifecycleListener _appLifecycleListener; - final ValueNotifier lifecycleListenable = - ValueNotifier(AppLifecycleState.inactive); + final ValueNotifier lifecycleListenable = ValueNotifier( + AppLifecycleState.inactive, + ); @override Widget build(BuildContext context) { diff --git a/samples/ads/lib/audio/audio_controller.dart b/samples/ads/lib/audio/audio_controller.dart index 0dd05d66..6d5be9d1 100644 --- a/samples/ads/lib/audio/audio_controller.dart +++ b/samples/ads/lib/audio/audio_controller.dart @@ -46,12 +46,13 @@ class AudioController { /// Background music does not count into the [polyphony] limit. Music will /// never be overridden by sound effects because that would be silly. AudioController({int polyphony = 2}) - : assert(polyphony >= 1), - _musicPlayer = AudioPlayer(playerId: 'musicPlayer'), - _sfxPlayers = Iterable.generate( - polyphony, (i) => AudioPlayer(playerId: 'sfxPlayer#$i')) - .toList(growable: false), - _playlist = Queue.of(List.of(songs)..shuffle()) { + : assert(polyphony >= 1), + _musicPlayer = AudioPlayer(playerId: 'musicPlayer'), + _sfxPlayers = Iterable.generate( + polyphony, + (i) => AudioPlayer(playerId: 'sfxPlayer#$i'), + ).toList(growable: false), + _playlist = Queue.of(List.of(songs)..shuffle()) { _musicPlayer.onPlayerComplete.listen(_handleSongFinished); unawaited(_preloadSfx()); } @@ -59,8 +60,10 @@ class AudioController { /// Makes sure the audio controller is listening to changes /// of both the app lifecycle (e.g. suspended app) and to changes /// of settings (e.g. muted sound). - void attachDependencies(AppLifecycleStateNotifier lifecycleNotifier, - SettingsController settingsController) { + void attachDependencies( + AppLifecycleStateNotifier lifecycleNotifier, + SettingsController settingsController, + ) { _attachLifecycleNotifier(lifecycleNotifier); _attachSettings(settingsController); } @@ -87,8 +90,9 @@ class AudioController { } final soundsOn = _settings?.soundsOn.value ?? false; if (!soundsOn) { - _log.fine(() => - 'Ignoring playing sound ($type) because sounds are turned off.'); + _log.fine( + () => 'Ignoring playing sound ($type) because sounds are turned off.', + ); return; } @@ -98,8 +102,10 @@ class AudioController { _log.fine(() => '- Chosen filename: $filename'); final currentPlayer = _sfxPlayers[_currentSfxPlayer]; - currentPlayer.play(AssetSource('sfx/$filename'), - volume: soundTypeToVolume(type)); + currentPlayer.play( + AssetSource('sfx/$filename'), + volume: soundTypeToVolume(type), + ); _currentSfxPlayer = (_currentSfxPlayer + 1) % _sfxPlayers.length; } @@ -211,10 +217,12 @@ class AudioController { // This assumes there is only a limited number of sound effects in the game. // If there are hundreds of long sound effect files, it's better // to be more selective when preloading. - await AudioCache.instance.loadAll(SfxType.values - .expand(soundTypeToFilename) - .map((path) => 'sfx/$path') - .toList()); + await AudioCache.instance.loadAll( + SfxType.values + .expand(soundTypeToFilename) + .map((path) => 'sfx/$path') + .toList(), + ); } void _soundsOnHandler() { @@ -227,8 +235,10 @@ class AudioController { void _startOrResumeMusic() async { if (_musicPlayer.source == null) { - _log.info('No music source set. ' - 'Start playing the current song in playlist.'); + _log.info( + 'No music source set. ' + 'Start playing the current song in playlist.', + ); await _playCurrentSongInPlaylist(); return; } diff --git a/samples/ads/lib/audio/sounds.dart b/samples/ads/lib/audio/sounds.dart index 139ac213..2929acb2 100644 --- a/samples/ads/lib/audio/sounds.dart +++ b/samples/ads/lib/audio/sounds.dart @@ -5,11 +5,7 @@ List soundTypeToFilename(SfxType type) { switch (type) { case SfxType.huhsh: - return const [ - 'hash1.mp3', - 'hash2.mp3', - 'hash3.mp3', - ]; + return const ['hash1.mp3', 'hash2.mp3', 'hash3.mp3']; case SfxType.wssh: return const [ 'wssh1.mp3', @@ -22,27 +18,13 @@ List soundTypeToFilename(SfxType type) { 'kss1.mp3', ]; case SfxType.buttonTap: - return const [ - 'k1.mp3', - 'k2.mp3', - 'p1.mp3', - 'p2.mp3', - ]; + return const ['k1.mp3', 'k2.mp3', 'p1.mp3', 'p2.mp3']; case SfxType.congrats: - return const [ - 'yay1.mp3', - 'wehee1.mp3', - 'oo1.mp3', - ]; + return const ['yay1.mp3', 'wehee1.mp3', 'oo1.mp3']; case SfxType.erase: - return const [ - 'fwfwfwfwfw1.mp3', - 'fwfwfwfw1.mp3', - ]; + return const ['fwfwfwfwfw1.mp3', 'fwfwfwfw1.mp3']; case SfxType.swishSwish: - return const [ - 'swishswish1.mp3', - ]; + return const ['swishswish1.mp3']; } } @@ -61,11 +43,4 @@ double soundTypeToVolume(SfxType type) { } } -enum SfxType { - huhsh, - wssh, - buttonTap, - congrats, - erase, - swishSwish, -} +enum SfxType { huhsh, wssh, buttonTap, congrats, erase, swishSwish } diff --git a/samples/ads/lib/game_internals/score.dart b/samples/ads/lib/game_internals/score.dart index ec9a1d67..8c8b3802 100644 --- a/samples/ads/lib/game_internals/score.dart +++ b/samples/ads/lib/game_internals/score.dart @@ -34,9 +34,12 @@ class Score { buf.write('$minutes'); } buf.write(':'); - buf.write((duration.inSeconds % Duration.secondsPerMinute) - .toString() - .padLeft(2, '0')); + buf.write( + (duration.inSeconds % Duration.secondsPerMinute).toString().padLeft( + 2, + '0', + ), + ); return buf.toString(); } diff --git a/samples/ads/lib/level_selection/level_selection_screen.dart b/samples/ads/lib/level_selection/level_selection_screen.dart index 511527b4..892f5b68 100644 --- a/samples/ads/lib/level_selection/level_selection_screen.dart +++ b/samples/ads/lib/level_selection/level_selection_screen.dart @@ -32,8 +32,10 @@ class LevelSelectionScreen extends StatelessWidget { child: Center( child: Text( 'Select level', - style: - TextStyle(fontFamily: 'Permanent Marker', fontSize: 30), + style: TextStyle( + fontFamily: 'Permanent Marker', + fontSize: 30, + ), ), ), ), @@ -43,18 +45,20 @@ class LevelSelectionScreen extends StatelessWidget { children: [ for (final level in gameLevels) ListTile( - enabled: playerProgress.highestLevelReached >= + enabled: + playerProgress.highestLevelReached >= level.number - 1, onTap: () { final audioController = context.read(); audioController.playSfx(SfxType.buttonTap); - GoRouter.of(context) - .go('/play/session/${level.number}'); + GoRouter.of( + context, + ).go('/play/session/${level.number}'); }, leading: Text(level.number.toString()), title: Text('Level #${level.number}'), - ) + ), ], ), ), diff --git a/samples/ads/lib/level_selection/levels.dart b/samples/ads/lib/level_selection/levels.dart index c8ef578f..c00d8401 100644 --- a/samples/ads/lib/level_selection/levels.dart +++ b/samples/ads/lib/level_selection/levels.dart @@ -12,10 +12,7 @@ const gameLevels = [ // You get this string when you configure an achievement in Play Console. achievementIdAndroid: 'NhkIwB69ejkMAOOLDb', ), - GameLevel( - number: 2, - difficulty: 42, - ), + GameLevel(number: 2, difficulty: 42), GameLevel( number: 3, difficulty: 100, @@ -42,8 +39,9 @@ class GameLevel { this.achievementIdIOS, this.achievementIdAndroid, }) : assert( - (achievementIdAndroid != null && achievementIdIOS != null) || - (achievementIdAndroid == null && achievementIdIOS == null), - 'Either both iOS and Android achievement ID must be provided, ' - 'or none'); + (achievementIdAndroid != null && achievementIdIOS != null) || + (achievementIdAndroid == null && achievementIdIOS == null), + 'Either both iOS and Android achievement ID must be provided, ' + 'or none', + ); } diff --git a/samples/ads/lib/main.dart b/samples/ads/lib/main.dart index 0809bb5c..8f6d6559 100644 --- a/samples/ads/lib/main.dart +++ b/samples/ads/lib/main.dart @@ -63,8 +63,11 @@ class MyApp extends StatelessWidget { Provider(create: (context) => Palette()), ChangeNotifierProvider(create: (context) => PlayerProgress()), // Set up audio. - ProxyProvider2( + ProxyProvider2< + AppLifecycleStateNotifier, + SettingsController, + AudioController + >( create: (context) => AudioController(), update: (context, lifecycleNotifier, settings, audio) { audio!.attachDependencies(lifecycleNotifier, settings); @@ -75,36 +78,39 @@ class MyApp extends StatelessWidget { lazy: false, ), ], - child: Builder(builder: (context) { - final palette = context.watch(); + child: Builder( + builder: (context) { + final palette = context.watch(); - return MaterialApp.router( - title: 'My Flutter Game', - theme: ThemeData.from( - colorScheme: ColorScheme.fromSeed( - seedColor: palette.darkPen, - surface: palette.backgroundMain, - ), - textTheme: TextTheme( - bodyMedium: TextStyle(color: palette.ink), - ), - useMaterial3: true, - ).copyWith( - // Make buttons more fun. - filledButtonTheme: FilledButtonThemeData( - style: FilledButton.styleFrom( - textStyle: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20, + return MaterialApp.router( + title: 'My Flutter Game', + theme: + ThemeData.from( + colorScheme: ColorScheme.fromSeed( + seedColor: palette.darkPen, + surface: palette.backgroundMain, + ), + textTheme: TextTheme( + bodyMedium: TextStyle(color: palette.ink), + ), + useMaterial3: true, + ).copyWith( + // Make buttons more fun. + filledButtonTheme: FilledButtonThemeData( + style: FilledButton.styleFrom( + textStyle: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20, + ), + ), + ), ), - ), - ), - ), - routeInformationProvider: router.routeInformationProvider, - routeInformationParser: router.routeInformationParser, - routerDelegate: router.routerDelegate, - ); - }), + routeInformationProvider: router.routeInformationProvider, + routeInformationParser: router.routeInformationParser, + routerDelegate: router.routerDelegate, + ); + }, + ), ), ); } diff --git a/samples/ads/lib/play_session/play_session_screen.dart b/samples/ads/lib/play_session/play_session_screen.dart index 6fbe7d9d..dd2cbc7c 100644 --- a/samples/ads/lib/play_session/play_session_screen.dart +++ b/samples/ads/lib/play_session/play_session_screen.dart @@ -62,10 +62,8 @@ class _PlaySessionScreenState extends State { // Create and provide the [LevelState] object that will be used // by widgets below this one in the widget tree. ChangeNotifierProvider( - create: (context) => LevelState( - goal: widget.level.difficulty, - onWin: _playerWon, - ), + create: (context) => + LevelState(goal: widget.level.difficulty, onWin: _playerWon), ), ], child: IgnorePointer( @@ -115,9 +113,7 @@ class _PlaySessionScreenState extends State { child: Visibility( visible: _duringCelebration, child: IgnorePointer( - child: Confetti( - isStopped: !_duringCelebration, - ), + child: Confetti(isStopped: !_duringCelebration), ), ), ), diff --git a/samples/ads/lib/player_progress/player_progress.dart b/samples/ads/lib/player_progress/player_progress.dart index 868d115a..6ce7b51d 100644 --- a/samples/ads/lib/player_progress/player_progress.dart +++ b/samples/ads/lib/player_progress/player_progress.dart @@ -23,7 +23,7 @@ class PlayerProgress extends ChangeNotifier { /// Creates an instance of [PlayerProgress] backed by an injected /// persistence [store]. PlayerProgress({PlayerProgressPersistence? store}) - : _store = store ?? LocalStoragePlayerProgressPersistence() { + : _store = store ?? LocalStoragePlayerProgressPersistence() { _getLatestFromStore(); } diff --git a/samples/ads/lib/router.dart b/samples/ads/lib/router.dart index 8ab0b8c4..a4cbe79e 100644 --- a/samples/ads/lib/router.dart +++ b/samples/ads/lib/router.dart @@ -25,58 +25,58 @@ final router = GoRouter( builder: (context, state) => const MainMenuScreen(key: Key('main menu')), routes: [ GoRoute( - path: 'play', - pageBuilder: (context, state) => buildMyTransition( - key: const ValueKey('play'), - color: context.watch().backgroundLevelSelection, - child: const LevelSelectionScreen( - key: Key('level selection'), + path: 'play', + pageBuilder: (context, state) => buildMyTransition( + key: const ValueKey('play'), + color: context.watch().backgroundLevelSelection, + child: const LevelSelectionScreen(key: Key('level selection')), + ), + routes: [ + GoRoute( + path: 'session/:level', + pageBuilder: (context, state) { + final levelNumber = int.parse(state.pathParameters['level']!); + final level = gameLevels.singleWhere( + (e) => e.number == levelNumber, + ); + return buildMyTransition( + key: const ValueKey('level'), + color: context.watch().backgroundPlaySession, + child: PlaySessionScreen( + level, + key: const Key('play session'), ), - ), - routes: [ - GoRoute( - path: 'session/:level', - pageBuilder: (context, state) { - final levelNumber = int.parse(state.pathParameters['level']!); - final level = - gameLevels.singleWhere((e) => e.number == levelNumber); - return buildMyTransition( - key: const ValueKey('level'), - color: context.watch().backgroundPlaySession, - child: PlaySessionScreen( - level, - key: const Key('play session'), - ), - ); - }, - ), - GoRoute( - path: 'won', - redirect: (context, state) { - if (state.extra == null) { - // Trying to navigate to a win screen without any data. - // Possibly by using the browser's back button. - return '/'; - } + ); + }, + ), + GoRoute( + path: 'won', + redirect: (context, state) { + if (state.extra == null) { + // Trying to navigate to a win screen without any data. + // Possibly by using the browser's back button. + return '/'; + } - // Otherwise, do not redirect. - return null; - }, - pageBuilder: (context, state) { - final map = state.extra! as Map; - final score = map['score'] as Score; + // Otherwise, do not redirect. + return null; + }, + pageBuilder: (context, state) { + final map = state.extra! as Map; + final score = map['score'] as Score; - return buildMyTransition( - key: const ValueKey('won'), - color: context.watch().backgroundPlaySession, - child: WinGameScreen( - score: score, - key: const Key('win game'), - ), - ); - }, - ) - ]), + return buildMyTransition( + key: const ValueKey('won'), + color: context.watch().backgroundPlaySession, + child: WinGameScreen( + score: score, + key: const Key('win game'), + ), + ); + }, + ), + ], + ), GoRoute( path: 'settings', builder: (context, state) => diff --git a/samples/ads/lib/settings/custom_name_dialog.dart b/samples/ads/lib/settings/custom_name_dialog.dart index 59dbcbb0..e95c0691 100644 --- a/samples/ads/lib/settings/custom_name_dialog.dart +++ b/samples/ads/lib/settings/custom_name_dialog.dart @@ -10,9 +10,10 @@ import 'settings.dart'; void showCustomNameDialog(BuildContext context) { showGeneralDialog( - context: context, - pageBuilder: (context, animation, secondaryAnimation) => - CustomNameDialog(animation: animation)); + context: context, + pageBuilder: (context, animation, secondaryAnimation) => + CustomNameDialog(animation: animation), + ); } class CustomNameDialog extends StatefulWidget { diff --git a/samples/ads/lib/settings/settings.dart b/samples/ads/lib/settings/settings.dart index 4b9f93d9..87cc3b64 100644 --- a/samples/ads/lib/settings/settings.dart +++ b/samples/ads/lib/settings/settings.dart @@ -41,7 +41,7 @@ class SettingsController { /// (i.e. NSUserDefaults on iOS, SharedPreferences on Android or /// local storage on the web). SettingsController({SettingsPersistence? store}) - : _store = store ?? LocalStorageSettingsPersistence() { + : _store = store ?? LocalStorageSettingsPersistence() { _loadStateFromPersistence(); } diff --git a/samples/ads/lib/settings/settings_screen.dart b/samples/ads/lib/settings/settings_screen.dart index c62142a1..f999af89 100644 --- a/samples/ads/lib/settings/settings_screen.dart +++ b/samples/ads/lib/settings/settings_screen.dart @@ -39,9 +39,7 @@ class SettingsScreen extends StatelessWidget { ), ), _gap, - const _NameChangeLine( - 'Name', - ), + const _NameChangeLine('Name'), ValueListenableBuilder( valueListenable: settings.soundsOn, builder: (context, soundsOn, child) => _SettingsLine( @@ -67,7 +65,8 @@ class SettingsScreen extends StatelessWidget { final messenger = ScaffoldMessenger.of(context); messenger.showSnackBar( const SnackBar( - content: Text('Player progress has been reset.')), + content: Text('Player progress has been reset.'), + ), ); }, ), @@ -102,11 +101,13 @@ class _NameChangeLine extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text(title, - style: const TextStyle( - fontFamily: 'Permanent Marker', - fontSize: 30, - )), + Text( + title, + style: const TextStyle( + fontFamily: 'Permanent Marker', + fontSize: 30, + ), + ), const Spacer(), ValueListenableBuilder( valueListenable: settings.playerName, diff --git a/samples/ads/lib/style/confetti.dart b/samples/ads/lib/style/confetti.dart index b8352246..107d1bbc 100644 --- a/samples/ads/lib/style/confetti.dart +++ b/samples/ads/lib/style/confetti.dart @@ -52,21 +52,21 @@ class ConfettiPainter extends CustomPainter { final UnmodifiableListView colors; - ConfettiPainter( - {required Listenable animation, required Iterable colors}) - : colors = UnmodifiableListView(colors), - super(repaint: animation); + ConfettiPainter({ + required Listenable animation, + required Iterable colors, + }) : colors = UnmodifiableListView(colors), + super(repaint: animation); @override void paint(Canvas canvas, Size size) { if (_size == null) { // First time we have a size. _snippings = List.generate( - snippingsCount, - (i) => _PaperSnipping( - frontColor: colors[i % colors.length], - bounds: size, - )); + snippingsCount, + (i) => + _PaperSnipping(frontColor: colors[i % colors.length], bounds: size), + ); } final didResize = _size != null && _size != size; @@ -97,10 +97,7 @@ class _ConfettiState extends State @override Widget build(BuildContext context) { return CustomPaint( - painter: ConfettiPainter( - colors: widget.colors, - animation: _controller, - ), + painter: ConfettiPainter(colors: widget.colors, animation: _controller), willChange: true, child: const SizedBox.expand(), ); @@ -181,10 +178,7 @@ class _PaperSnipping { final paint = Paint()..style = PaintingStyle.fill; - _PaperSnipping({ - required this.frontColor, - required Size bounds, - }) : _bounds = bounds; + _PaperSnipping({required this.frontColor, required this._bounds}); void draw(Canvas canvas) { if (cosA > 0) { @@ -196,11 +190,12 @@ class _PaperSnipping { final path = Path() ..addPolygon( List.generate( - 4, - (index) => Offset( - position.x + corners[index].x * size, - position.y + corners[index].y * size * cosA, - )), + 4, + (index) => Offset( + position.x + corners[index].x * size, + position.y + corners[index].y * size * cosA, + ), + ), true, ); canvas.drawPath(path, paint); diff --git a/samples/ads/lib/style/my_button.dart b/samples/ads/lib/style/my_button.dart index d8dce670..3e60ee6c 100644 --- a/samples/ads/lib/style/my_button.dart +++ b/samples/ads/lib/style/my_button.dart @@ -41,10 +41,7 @@ class _MyButtonState extends State }, child: RotationTransition( turns: _controller.drive(const _MySineTween(0.005)), - child: FilledButton( - onPressed: widget.onPressed, - child: widget.child, - ), + child: FilledButton(onPressed: widget.onPressed, child: widget.child), ), ); } diff --git a/samples/ads/lib/style/my_transition.dart b/samples/ads/lib/style/my_transition.dart index 9c44d3dd..c845af97 100644 --- a/samples/ads/lib/style/my_transition.dart +++ b/samples/ads/lib/style/my_transition.dart @@ -16,11 +16,7 @@ CustomTransitionPage buildMyTransition({ return CustomTransitionPage( child: child, transitionsBuilder: (context, animation, secondaryAnimation, child) { - return _MyReveal( - animation: animation, - color: color, - child: child, - ); + return _MyReveal(animation: animation, color: color, child: child); }, key: key, name: name, @@ -63,14 +59,9 @@ class _MyReveal extends StatelessWidget { reverseCurve: Curves.easeOutCubic, ), ), - child: Container( - color: color, - ), - ), - FadeTransition( - opacity: _fadeTween.animate(animation), - child: child, + child: Container(color: color), ), + FadeTransition(opacity: _fadeTween.animate(animation), child: child), ], ); } diff --git a/samples/ads/lib/style/responsive_screen.dart b/samples/ads/lib/style/responsive_screen.dart index a6d7ebe2..739d5a02 100644 --- a/samples/ads/lib/style/responsive_screen.dart +++ b/samples/ads/lib/style/responsive_screen.dart @@ -41,10 +41,7 @@ class ResponsiveScreen extends StatelessWidget { children: [ SafeArea( bottom: false, - child: Padding( - padding: padding, - child: topMessageArea, - ), + child: Padding(padding: padding, child: topMessageArea), ), Expanded( child: SafeArea( @@ -59,9 +56,7 @@ class ResponsiveScreen extends StatelessWidget { maintainBottomViewPadding: true, child: Padding( padding: padding, - child: Center( - child: rectangularMenuArea, - ), + child: Center(child: rectangularMenuArea), ), ), ], @@ -90,10 +85,7 @@ class ResponsiveScreen extends StatelessWidget { bottom: false, left: false, maintainBottomViewPadding: true, - child: Padding( - padding: padding, - child: topMessageArea, - ), + child: Padding(padding: padding, child: topMessageArea), ), Expanded( child: SafeArea( @@ -108,7 +100,7 @@ class ResponsiveScreen extends StatelessWidget { ), ), ), - ) + ), ], ), ), diff --git a/samples/ads/lib/win_game/win_game_screen.dart b/samples/ads/lib/win_game/win_game_screen.dart index a25373f2..0a3ec916 100644 --- a/samples/ads/lib/win_game/win_game_screen.dart +++ b/samples/ads/lib/win_game/win_game_screen.dart @@ -15,10 +15,7 @@ import '../style/responsive_screen.dart'; class WinGameScreen extends StatelessWidget { final Score score; - const WinGameScreen({ - super.key, - required this.score, - }); + const WinGameScreen({super.key, required this.score}); @override Widget build(BuildContext context) { @@ -47,7 +44,9 @@ class WinGameScreen extends StatelessWidget { 'Score: ${score.score}\n' 'Time: ${score.formattedTime}', style: const TextStyle( - fontFamily: 'Permanent Marker', fontSize: 20), + fontFamily: 'Permanent Marker', + fontSize: 20, + ), ), ), ], diff --git a/samples/ads/pubspec.yaml b/samples/ads/pubspec.yaml index a1e10a72..632c340d 100644 --- a/samples/ads/pubspec.yaml +++ b/samples/ads/pubspec.yaml @@ -7,25 +7,25 @@ publish_to: 'none' version: 0.0.1+1 environment: - sdk: ^3.5.0 + sdk: ^3.12.0 dependencies: flutter: sdk: flutter - audioplayers: ^6.0.0 - go_router: ^16.0.0 - google_mobile_ads: ^6.0.0 - logging: ^1.2.0 - provider: ^6.1.2 - shared_preferences: ^2.2.3 + audioplayers: ^6.8.1 + go_router: ^17.3.0 + google_mobile_ads: ^9.0.0 + logging: ^1.3.0 + provider: ^6.1.5+1 + shared_preferences: ^2.5.5 dev_dependencies: flutter_lints: ^6.0.0 flutter_test: sdk: flutter - flutter_launcher_icons: ^0.14.3 - test: ^1.24.3 + flutter_launcher_icons: ^0.14.4 + test: ^1.31.0 flutter: uses-material-design: true diff --git a/samples/crossword/analysis_options.yaml b/samples/crossword/analysis_options.yaml index c9350a29..90ed13a2 100644 --- a/samples/crossword/analysis_options.yaml +++ b/samples/crossword/analysis_options.yaml @@ -1,6 +1,14 @@ +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** include: package:flutter_lints/flutter.yaml linter: rules: prefer_single_quotes: true - diff --git a/samples/crossword/lib/model.g.dart b/samples/crossword/lib/model.g.dart index dfedcd96..4f25b1d9 100644 --- a/samples/crossword/lib/model.g.dart +++ b/samples/crossword/lib/model.g.dart @@ -7,7 +7,7 @@ part of 'model.dart'; // ************************************************************************** Serializers _$serializers = - (new Serializers().toBuilder() + (Serializers().toBuilder() ..add(Crossword.serializer) ..add(CrosswordCharacter.serializer) ..add(CrosswordPuzzleGame.serializer) @@ -17,14 +17,14 @@ Serializers _$serializers = ..add(WorkQueue.serializer) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(CrosswordWord)]), - () => new ListBuilder(), + () => ListBuilder(), ) ..addBuilderFactory( const FullType(BuiltMap, const [ const FullType(Location), const FullType(CrosswordCharacter), ]), - () => new MapBuilder(), + () => MapBuilder(), ) ..addBuilderFactory( const FullType(BuiltMap, const [ @@ -35,41 +35,38 @@ Serializers _$serializers = ]), ]), () => - new MapBuilder< - Location, - BuiltMap> - >(), + MapBuilder>>(), ) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(CrosswordWord)]), - () => new ListBuilder(), + () => ListBuilder(), ) ..addBuilderFactory( const FullType(BuiltMap, const [ const FullType(Location), const FullType(Direction), ]), - () => new MapBuilder(), + () => MapBuilder(), ) ..addBuilderFactory( const FullType(BuiltSet, const [const FullType(Location)]), - () => new SetBuilder(), + () => SetBuilder(), ) ..addBuilderFactory( const FullType(BuiltSet, const [const FullType(String)]), - () => new SetBuilder(), + () => SetBuilder(), )) .build(); -Serializer _$locationSerializer = new _$LocationSerializer(); +Serializer _$locationSerializer = _$LocationSerializer(); Serializer _$crosswordWordSerializer = - new _$CrosswordWordSerializer(); + _$CrosswordWordSerializer(); Serializer _$crosswordCharacterSerializer = - new _$CrosswordCharacterSerializer(); -Serializer _$crosswordSerializer = new _$CrosswordSerializer(); -Serializer _$workQueueSerializer = new _$WorkQueueSerializer(); -Serializer _$displayInfoSerializer = new _$DisplayInfoSerializer(); + _$CrosswordCharacterSerializer(); +Serializer _$crosswordSerializer = _$CrosswordSerializer(); +Serializer _$workQueueSerializer = _$WorkQueueSerializer(); +Serializer _$displayInfoSerializer = _$DisplayInfoSerializer(); Serializer _$crosswordPuzzleGameSerializer = - new _$CrosswordPuzzleGameSerializer(); + _$CrosswordPuzzleGameSerializer(); class _$LocationSerializer implements StructuredSerializer { @override @@ -99,7 +96,7 @@ class _$LocationSerializer implements StructuredSerializer { Iterable serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = new LocationBuilder(); + final result = LocationBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -166,7 +163,7 @@ class _$CrosswordWordSerializer implements StructuredSerializer { Iterable serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = new CrosswordWordBuilder(); + final result = CrosswordWordBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -258,7 +255,7 @@ class _$CrosswordCharacterSerializer Iterable serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = new CrosswordCharacterBuilder(); + final result = CrosswordCharacterBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -342,7 +339,7 @@ class _$CrosswordSerializer implements StructuredSerializer { Iterable serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = new CrosswordBuilder(); + final result = CrosswordBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -444,7 +441,7 @@ class _$WorkQueueSerializer implements StructuredSerializer { Iterable serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = new WorkQueueBuilder(); + final result = WorkQueueBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -550,7 +547,7 @@ class _$DisplayInfoSerializer implements StructuredSerializer { Iterable serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = new DisplayInfoBuilder(); + final result = DisplayInfoBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -656,7 +653,7 @@ class _$CrosswordPuzzleGameSerializer Iterable serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = new CrosswordPuzzleGameBuilder(); + final result = CrosswordPuzzleGameBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { @@ -712,19 +709,15 @@ class _$Location extends Location { final int y; factory _$Location([void Function(LocationBuilder)? updates]) => - (new LocationBuilder()..update(updates))._build(); - - _$Location._({required this.x, required this.y}) : super._() { - BuiltValueNullFieldError.checkNotNull(x, r'Location', 'x'); - BuiltValueNullFieldError.checkNotNull(y, r'Location', 'y'); - } + (LocationBuilder()..update(updates))._build(); + _$Location._({required this.x, required this.y}) : super._(); @override Location rebuild(void Function(LocationBuilder) updates) => (toBuilder()..update(updates)).build(); @override - LocationBuilder toBuilder() => new LocationBuilder()..replace(this); + LocationBuilder toBuilder() => LocationBuilder()..replace(this); @override bool operator ==(Object other) { @@ -775,7 +768,6 @@ class LocationBuilder implements Builder { @override void replace(Location other) { - ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Location; } @@ -790,7 +782,7 @@ class LocationBuilder implements Builder { _$Location _build() { final _$result = _$v ?? - new _$Location._( + _$Location._( x: BuiltValueNullFieldError.checkNotNull(x, r'Location', 'x'), y: BuiltValueNullFieldError.checkNotNull(y, r'Location', 'y'), ); @@ -808,32 +800,19 @@ class _$CrosswordWord extends CrosswordWord { final Direction direction; factory _$CrosswordWord([void Function(CrosswordWordBuilder)? updates]) => - (new CrosswordWordBuilder()..update(updates))._build(); + (CrosswordWordBuilder()..update(updates))._build(); _$CrosswordWord._({ required this.word, required this.location, required this.direction, - }) : super._() { - BuiltValueNullFieldError.checkNotNull(word, r'CrosswordWord', 'word'); - BuiltValueNullFieldError.checkNotNull( - location, - r'CrosswordWord', - 'location', - ); - BuiltValueNullFieldError.checkNotNull( - direction, - r'CrosswordWord', - 'direction', - ); - } - + }) : super._(); @override CrosswordWord rebuild(void Function(CrosswordWordBuilder) updates) => (toBuilder()..update(updates)).build(); @override - CrosswordWordBuilder toBuilder() => new CrosswordWordBuilder()..replace(this); + CrosswordWordBuilder toBuilder() => CrosswordWordBuilder()..replace(this); @override bool operator ==(Object other) { @@ -873,7 +852,7 @@ class CrosswordWordBuilder set word(String? word) => _$this._word = word; LocationBuilder? _location; - LocationBuilder get location => _$this._location ??= new LocationBuilder(); + LocationBuilder get location => _$this._location ??= LocationBuilder(); set location(LocationBuilder? location) => _$this._location = location; Direction? _direction; @@ -895,7 +874,6 @@ class CrosswordWordBuilder @override void replace(CrosswordWord other) { - ArgumentError.checkNotNull(other, 'other'); _$v = other as _$CrosswordWord; } @@ -912,7 +890,7 @@ class CrosswordWordBuilder try { _$result = _$v ?? - new _$CrosswordWord._( + _$CrosswordWord._( word: BuiltValueNullFieldError.checkNotNull( word, r'CrosswordWord', @@ -931,7 +909,7 @@ class CrosswordWordBuilder _$failedField = 'location'; location.build(); } catch (e) { - throw new BuiltValueNestedFieldError( + throw BuiltValueNestedFieldError( r'CrosswordWord', _$failedField, e.toString(), @@ -954,20 +932,13 @@ class _$CrosswordCharacter extends CrosswordCharacter { factory _$CrosswordCharacter([ void Function(CrosswordCharacterBuilder)? updates, - ]) => (new CrosswordCharacterBuilder()..update(updates))._build(); + ]) => (CrosswordCharacterBuilder()..update(updates))._build(); _$CrosswordCharacter._({ required this.character, this.acrossWord, this.downWord, - }) : super._() { - BuiltValueNullFieldError.checkNotNull( - character, - r'CrosswordCharacter', - 'character', - ); - } - + }) : super._(); @override CrosswordCharacter rebuild( void Function(CrosswordCharacterBuilder) updates, @@ -975,7 +946,7 @@ class _$CrosswordCharacter extends CrosswordCharacter { @override CrosswordCharacterBuilder toBuilder() => - new CrosswordCharacterBuilder()..replace(this); + CrosswordCharacterBuilder()..replace(this); @override bool operator ==(Object other) { @@ -1016,13 +987,13 @@ class CrosswordCharacterBuilder CrosswordWordBuilder? _acrossWord; CrosswordWordBuilder get acrossWord => - _$this._acrossWord ??= new CrosswordWordBuilder(); + _$this._acrossWord ??= CrosswordWordBuilder(); set acrossWord(CrosswordWordBuilder? acrossWord) => _$this._acrossWord = acrossWord; CrosswordWordBuilder? _downWord; CrosswordWordBuilder get downWord => - _$this._downWord ??= new CrosswordWordBuilder(); + _$this._downWord ??= CrosswordWordBuilder(); set downWord(CrosswordWordBuilder? downWord) => _$this._downWord = downWord; CrosswordCharacterBuilder(); @@ -1040,7 +1011,6 @@ class CrosswordCharacterBuilder @override void replace(CrosswordCharacter other) { - ArgumentError.checkNotNull(other, 'other'); _$v = other as _$CrosswordCharacter; } @@ -1057,7 +1027,7 @@ class CrosswordCharacterBuilder try { _$result = _$v ?? - new _$CrosswordCharacter._( + _$CrosswordCharacter._( character: BuiltValueNullFieldError.checkNotNull( character, r'CrosswordCharacter', @@ -1074,7 +1044,7 @@ class CrosswordCharacterBuilder _$failedField = 'downWord'; _downWord?.build(); } catch (e) { - throw new BuiltValueNestedFieldError( + throw BuiltValueNestedFieldError( r'CrosswordCharacter', _$failedField, e.toString(), @@ -1098,30 +1068,20 @@ class _$Crossword extends Crossword { final BuiltMap characters; factory _$Crossword([void Function(CrosswordBuilder)? updates]) => - (new CrosswordBuilder()..update(updates))._build(); + (CrosswordBuilder()..update(updates))._build(); _$Crossword._({ required this.width, required this.height, required this.words, required this.characters, - }) : super._() { - BuiltValueNullFieldError.checkNotNull(width, r'Crossword', 'width'); - BuiltValueNullFieldError.checkNotNull(height, r'Crossword', 'height'); - BuiltValueNullFieldError.checkNotNull(words, r'Crossword', 'words'); - BuiltValueNullFieldError.checkNotNull( - characters, - r'Crossword', - 'characters', - ); - } - + }) : super._(); @override Crossword rebuild(void Function(CrosswordBuilder) updates) => (toBuilder()..update(updates)).build(); @override - CrosswordBuilder toBuilder() => new CrosswordBuilder()..replace(this); + CrosswordBuilder toBuilder() => CrosswordBuilder()..replace(this); @override bool operator ==(Object other) { @@ -1168,12 +1128,12 @@ class CrosswordBuilder implements Builder { ListBuilder? _words; ListBuilder get words => - _$this._words ??= new ListBuilder(); + _$this._words ??= ListBuilder(); set words(ListBuilder? words) => _$this._words = words; MapBuilder? _characters; MapBuilder get characters => - _$this._characters ??= new MapBuilder(); + _$this._characters ??= MapBuilder(); set characters(MapBuilder? characters) => _$this._characters = characters; @@ -1193,7 +1153,6 @@ class CrosswordBuilder implements Builder { @override void replace(Crossword other) { - ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Crossword; } @@ -1211,7 +1170,7 @@ class CrosswordBuilder implements Builder { try { _$result = _$v ?? - new _$Crossword._( + _$Crossword._( width: BuiltValueNullFieldError.checkNotNull( width, r'Crossword', @@ -1233,7 +1192,7 @@ class CrosswordBuilder implements Builder { _$failedField = 'characters'; characters.build(); } catch (e) { - throw new BuiltValueNestedFieldError( + throw BuiltValueNestedFieldError( r'Crossword', _$failedField, e.toString(), @@ -1257,38 +1216,20 @@ class _$WorkQueue extends WorkQueue { final BuiltSet candidateWords; factory _$WorkQueue([void Function(WorkQueueBuilder)? updates]) => - (new WorkQueueBuilder()..update(updates))._build(); + (WorkQueueBuilder()..update(updates))._build(); _$WorkQueue._({ required this.crossword, required this.locationsToTry, required this.badLocations, required this.candidateWords, - }) : super._() { - BuiltValueNullFieldError.checkNotNull(crossword, r'WorkQueue', 'crossword'); - BuiltValueNullFieldError.checkNotNull( - locationsToTry, - r'WorkQueue', - 'locationsToTry', - ); - BuiltValueNullFieldError.checkNotNull( - badLocations, - r'WorkQueue', - 'badLocations', - ); - BuiltValueNullFieldError.checkNotNull( - candidateWords, - r'WorkQueue', - 'candidateWords', - ); - } - + }) : super._(); @override WorkQueue rebuild(void Function(WorkQueueBuilder) updates) => (toBuilder()..update(updates)).build(); @override - WorkQueueBuilder toBuilder() => new WorkQueueBuilder()..replace(this); + WorkQueueBuilder toBuilder() => WorkQueueBuilder()..replace(this); @override bool operator ==(Object other) { @@ -1326,25 +1267,24 @@ class WorkQueueBuilder implements Builder { _$WorkQueue? _$v; CrosswordBuilder? _crossword; - CrosswordBuilder get crossword => - _$this._crossword ??= new CrosswordBuilder(); + CrosswordBuilder get crossword => _$this._crossword ??= CrosswordBuilder(); set crossword(CrosswordBuilder? crossword) => _$this._crossword = crossword; MapBuilder? _locationsToTry; MapBuilder get locationsToTry => - _$this._locationsToTry ??= new MapBuilder(); + _$this._locationsToTry ??= MapBuilder(); set locationsToTry(MapBuilder? locationsToTry) => _$this._locationsToTry = locationsToTry; SetBuilder? _badLocations; SetBuilder get badLocations => - _$this._badLocations ??= new SetBuilder(); + _$this._badLocations ??= SetBuilder(); set badLocations(SetBuilder? badLocations) => _$this._badLocations = badLocations; SetBuilder? _candidateWords; SetBuilder get candidateWords => - _$this._candidateWords ??= new SetBuilder(); + _$this._candidateWords ??= SetBuilder(); set candidateWords(SetBuilder? candidateWords) => _$this._candidateWords = candidateWords; @@ -1364,7 +1304,6 @@ class WorkQueueBuilder implements Builder { @override void replace(WorkQueue other) { - ArgumentError.checkNotNull(other, 'other'); _$v = other as _$WorkQueue; } @@ -1381,7 +1320,7 @@ class WorkQueueBuilder implements Builder { try { _$result = _$v ?? - new _$WorkQueue._( + _$WorkQueue._( crossword: crossword.build(), locationsToTry: locationsToTry.build(), badLocations: badLocations.build(), @@ -1399,7 +1338,7 @@ class WorkQueueBuilder implements Builder { _$failedField = 'candidateWords'; candidateWords.build(); } catch (e) { - throw new BuiltValueNestedFieldError( + throw BuiltValueNestedFieldError( r'WorkQueue', _$failedField, e.toString(), @@ -1425,7 +1364,7 @@ class _$DisplayInfo extends DisplayInfo { final String gridFilledPercentage; factory _$DisplayInfo([void Function(DisplayInfoBuilder)? updates]) => - (new DisplayInfoBuilder()..update(updates))._build(); + (DisplayInfoBuilder()..update(updates))._build(); _$DisplayInfo._({ required this.wordsInGridCount, @@ -1433,40 +1372,13 @@ class _$DisplayInfo extends DisplayInfo { required this.locationsToExploreCount, required this.knownBadLocationsCount, required this.gridFilledPercentage, - }) : super._() { - BuiltValueNullFieldError.checkNotNull( - wordsInGridCount, - r'DisplayInfo', - 'wordsInGridCount', - ); - BuiltValueNullFieldError.checkNotNull( - candidateWordsCount, - r'DisplayInfo', - 'candidateWordsCount', - ); - BuiltValueNullFieldError.checkNotNull( - locationsToExploreCount, - r'DisplayInfo', - 'locationsToExploreCount', - ); - BuiltValueNullFieldError.checkNotNull( - knownBadLocationsCount, - r'DisplayInfo', - 'knownBadLocationsCount', - ); - BuiltValueNullFieldError.checkNotNull( - gridFilledPercentage, - r'DisplayInfo', - 'gridFilledPercentage', - ); - } - + }) : super._(); @override DisplayInfo rebuild(void Function(DisplayInfoBuilder) updates) => (toBuilder()..update(updates)).build(); @override - DisplayInfoBuilder toBuilder() => new DisplayInfoBuilder()..replace(this); + DisplayInfoBuilder toBuilder() => DisplayInfoBuilder()..replace(this); @override bool operator ==(Object other) { @@ -1548,7 +1460,6 @@ class DisplayInfoBuilder implements Builder { @override void replace(DisplayInfo other) { - ArgumentError.checkNotNull(other, 'other'); _$v = other as _$DisplayInfo; } @@ -1563,7 +1474,7 @@ class DisplayInfoBuilder implements Builder { _$DisplayInfo _build() { final _$result = _$v ?? - new _$DisplayInfo._( + _$DisplayInfo._( wordsInGridCount: BuiltValueNullFieldError.checkNotNull( wordsInGridCount, r'DisplayInfo', @@ -1606,30 +1517,13 @@ class _$CrosswordPuzzleGame extends CrosswordPuzzleGame { factory _$CrosswordPuzzleGame([ void Function(CrosswordPuzzleGameBuilder)? updates, - ]) => (new CrosswordPuzzleGameBuilder()..update(updates))._build(); + ]) => (CrosswordPuzzleGameBuilder()..update(updates))._build(); _$CrosswordPuzzleGame._({ required this.crossword, required this.alternateWords, required this.selectedWords, - }) : super._() { - BuiltValueNullFieldError.checkNotNull( - crossword, - r'CrosswordPuzzleGame', - 'crossword', - ); - BuiltValueNullFieldError.checkNotNull( - alternateWords, - r'CrosswordPuzzleGame', - 'alternateWords', - ); - BuiltValueNullFieldError.checkNotNull( - selectedWords, - r'CrosswordPuzzleGame', - 'selectedWords', - ); - } - + }) : super._(); @override CrosswordPuzzleGame rebuild( void Function(CrosswordPuzzleGameBuilder) updates, @@ -1637,7 +1531,7 @@ class _$CrosswordPuzzleGame extends CrosswordPuzzleGame { @override CrosswordPuzzleGameBuilder toBuilder() => - new CrosswordPuzzleGameBuilder()..replace(this); + CrosswordPuzzleGameBuilder()..replace(this); @override bool operator ==(Object other) { @@ -1673,14 +1567,13 @@ class CrosswordPuzzleGameBuilder _$CrosswordPuzzleGame? _$v; CrosswordBuilder? _crossword; - CrosswordBuilder get crossword => - _$this._crossword ??= new CrosswordBuilder(); + CrosswordBuilder get crossword => _$this._crossword ??= CrosswordBuilder(); set crossword(CrosswordBuilder? crossword) => _$this._crossword = crossword; MapBuilder>>? _alternateWords; MapBuilder>> get alternateWords => _$this._alternateWords ??= - new MapBuilder>>(); + MapBuilder>>(); set alternateWords( MapBuilder>>? alternateWords, @@ -1688,7 +1581,7 @@ class CrosswordPuzzleGameBuilder ListBuilder? _selectedWords; ListBuilder get selectedWords => - _$this._selectedWords ??= new ListBuilder(); + _$this._selectedWords ??= ListBuilder(); set selectedWords(ListBuilder? selectedWords) => _$this._selectedWords = selectedWords; @@ -1707,7 +1600,6 @@ class CrosswordPuzzleGameBuilder @override void replace(CrosswordPuzzleGame other) { - ArgumentError.checkNotNull(other, 'other'); _$v = other as _$CrosswordPuzzleGame; } @@ -1724,7 +1616,7 @@ class CrosswordPuzzleGameBuilder try { _$result = _$v ?? - new _$CrosswordPuzzleGame._( + _$CrosswordPuzzleGame._( crossword: crossword.build(), alternateWords: alternateWords.build(), selectedWords: selectedWords.build(), @@ -1739,7 +1631,7 @@ class CrosswordPuzzleGameBuilder _$failedField = 'selectedWords'; selectedWords.build(); } catch (e) { - throw new BuiltValueNestedFieldError( + throw BuiltValueNestedFieldError( r'CrosswordPuzzleGame', _$failedField, e.toString(), diff --git a/samples/crossword/lib/providers.dart b/samples/crossword/lib/providers.dart index e7e9b1ac..927941a6 100644 --- a/samples/crossword/lib/providers.dart +++ b/samples/crossword/lib/providers.dart @@ -7,7 +7,6 @@ import 'dart:convert'; import 'package:built_collection/built_collection.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; -import 'package:riverpod/riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'isolates.dart'; diff --git a/samples/crossword/lib/providers.g.dart b/samples/crossword/lib/providers.g.dart index a1745350..c6149606 100644 --- a/samples/crossword/lib/providers.g.dart +++ b/samples/crossword/lib/providers.g.dart @@ -6,74 +6,197 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$wordListHash() => r'07003444d7241448561b638500001e31610b4717'; - +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning /// A provider for the wordlist to use when generating the crossword. -/// -/// Copied from [wordList]. + @ProviderFor(wordList) -final wordListProvider = AutoDisposeFutureProvider>.internal( - wordList, - name: r'wordListProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$wordListHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef WordListRef = AutoDisposeFutureProviderRef>; -String _$workQueueHash() => r'297192935b85a20243519048088822c6ff30dbac'; +final wordListProvider = WordListProvider._(); -/// See also [workQueue]. -@ProviderFor(workQueue) -final workQueueProvider = AutoDisposeStreamProvider.internal( - workQueue, - name: r'workQueueProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$workQueueHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef WorkQueueRef = AutoDisposeStreamProviderRef; -String _$sizeHash() => r'e551985965bf4119e8d90c0e8aa4f4d68a555b73'; +/// A provider for the wordlist to use when generating the crossword. + +final class WordListProvider + extends + $FunctionalProvider< + AsyncValue>, + BuiltSet, + FutureOr> + > + with $FutureModifier>, $FutureProvider> { + /// A provider for the wordlist to use when generating the crossword. + WordListProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'wordListProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$wordListHash(); + + @$internal + @override + $FutureProviderElement> $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); + + @override + FutureOr> create(Ref ref) { + return wordList(ref); + } +} + +String _$wordListHash() => r'07003444d7241448561b638500001e31610b4717'; /// A provider that holds the current size of the crossword to generate. -/// -/// Copied from [Size]. + @ProviderFor(Size) -final sizeProvider = NotifierProvider.internal( - Size.new, - name: r'sizeProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$sizeHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$Size = Notifier; -String _$puzzleHash() => r'dddad218b4318b008af2db67dd0ff284bcef3231'; +final sizeProvider = SizeProvider._(); + +/// A provider that holds the current size of the crossword to generate. +final class SizeProvider extends $NotifierProvider { + /// A provider that holds the current size of the crossword to generate. + SizeProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'sizeProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$sizeHash(); + + @$internal + @override + Size create() => Size(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(CrosswordSize value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$sizeHash() => r'e551985965bf4119e8d90c0e8aa4f4d68a555b73'; + +/// A provider that holds the current size of the crossword to generate. + +abstract class _$Size extends $Notifier { + CrosswordSize build(); + @$mustCallSuper + @override + WhenComplete runBuild() { + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + CrosswordSize, + Object?, + Object? + >; + return element.handleCreate(ref, build); + } +} + +@ProviderFor(workQueue) +final workQueueProvider = WorkQueueProvider._(); + +final class WorkQueueProvider + extends + $FunctionalProvider< + AsyncValue, + model.WorkQueue, + Stream + > + with $FutureModifier, $StreamProvider { + WorkQueueProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'workQueueProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$workQueueHash(); + + @$internal + @override + $StreamProviderElement $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + return workQueue(ref); + } +} + +String _$workQueueHash() => r'297192935b85a20243519048088822c6ff30dbac'; -/// See also [Puzzle]. @ProviderFor(Puzzle) -final puzzleProvider = - AutoDisposeNotifierProvider.internal( - Puzzle.new, - name: r'puzzleProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$puzzleHash, - dependencies: null, - allTransitiveDependencies: null, +final puzzleProvider = PuzzleProvider._(); + +final class PuzzleProvider + extends $NotifierProvider { + PuzzleProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'puzzleProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$puzzleHash(); + + @$internal + @override + Puzzle create() => Puzzle(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(model.CrosswordPuzzleGame value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), ); + } +} + +String _$puzzleHash() => r'dddad218b4318b008af2db67dd0ff284bcef3231'; -typedef _$Puzzle = AutoDisposeNotifier; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package +abstract class _$Puzzle extends $Notifier { + model.CrosswordPuzzleGame build(); + @$mustCallSuper + @override + WhenComplete runBuild() { + final ref = + this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + model.CrosswordPuzzleGame, + Object?, + Object? + >; + return element.handleCreate(ref, build); + } +} diff --git a/samples/crossword/pubspec.yaml b/samples/crossword/pubspec.yaml index c59eb6b4..d613d79a 100644 --- a/samples/crossword/pubspec.yaml +++ b/samples/crossword/pubspec.yaml @@ -4,28 +4,28 @@ publish_to: none version: 0.1.0 environment: - sdk: ^3.8.0 + sdk: ^3.12.0 dependencies: built_collection: ^5.1.1 - built_value: ^8.9.2 - characters: ^1.3.0 + built_value: ^8.12.6 + characters: ^1.4.1 flutter: sdk: flutter - flutter_riverpod: ^2.6.1 - intl: ^0.20.2 - riverpod: ^2.6.1 - riverpod_annotation: ^2.6.1 - two_dimensional_scrollables: ^0.3.6 + flutter_riverpod: ^3.3.2 + intl: ^0.20.3 + riverpod: ^3.3.2 + riverpod_annotation: ^4.0.3 + two_dimensional_scrollables: ^0.5.3 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^6.0.0 - build_runner: ^2.4.10 - built_value_generator: ^8.9.2 - riverpod_generator: ^2.6.1 - riverpod_lint: ^2.6.1 + build_runner: ^2.15.1 + built_value_generator: ^8.12.5 + riverpod_generator: ^4.0.4 + riverpod_lint: ^3.1.4 flutter: uses-material-design: true diff --git a/samples/multiplayer/.metadata b/samples/multiplayer/.metadata index 8c1351f2..183e38b9 100644 --- a/samples/multiplayer/.metadata +++ b/samples/multiplayer/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "6fba2447e95c451518584c35e25f5433f14d888c" + revision: "058e0af2c2b57e369d905a03ac9748b0ebf543c6" channel: "stable" project_type: app @@ -13,23 +13,23 @@ project_type: app migration: platforms: - platform: root - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: android - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: ios - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: linux - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: macos - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: web - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 # User provided section diff --git a/samples/multiplayer/analysis_options.yaml b/samples/multiplayer/analysis_options.yaml index 01ceeb04..ca32b516 100644 --- a/samples/multiplayer/analysis_options.yaml +++ b/samples/multiplayer/analysis_options.yaml @@ -1,6 +1,14 @@ include: package:flutter_lints/flutter.yaml analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** language: strict-casts: true diff --git a/samples/multiplayer/android/app/build.gradle.kts b/samples/multiplayer/android/app/build.gradle.kts index 18375662..5ecc5227 100644 --- a/samples/multiplayer/android/app/build.gradle.kts +++ b/samples/multiplayer/android/app/build.gradle.kts @@ -3,7 +3,6 @@ plugins { // START: FlutterFire Configuration id("com.google.gms.google-services") // END: FlutterFire Configuration - id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } @@ -14,12 +13,8 @@ android { ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { @@ -42,6 +37,12 @@ android { } } +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + flutter { source = "../.." } diff --git a/samples/multiplayer/android/build.gradle.kts b/samples/multiplayer/android/build.gradle.kts index 89176ef4..dbee657b 100644 --- a/samples/multiplayer/android/build.gradle.kts +++ b/samples/multiplayer/android/build.gradle.kts @@ -5,7 +5,10 @@ allprojects { } } -val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() rootProject.layout.buildDirectory.value(newBuildDir) subprojects { diff --git a/samples/multiplayer/android/gradle.properties b/samples/multiplayer/android/gradle.properties index f018a618..e96108cf 100644 --- a/samples/multiplayer/android/gradle.properties +++ b/samples/multiplayer/android/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/samples/multiplayer/android/gradle/wrapper/gradle-wrapper.properties b/samples/multiplayer/android/gradle/wrapper/gradle-wrapper.properties index ac3b4792..2d428bfb 100644 --- a/samples/multiplayer/android/gradle/wrapper/gradle-wrapper.properties +++ b/samples/multiplayer/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip diff --git a/samples/multiplayer/android/settings.gradle.kts b/samples/multiplayer/android/settings.gradle.kts index bd7522f7..19e7cdad 100644 --- a/samples/multiplayer/android/settings.gradle.kts +++ b/samples/multiplayer/android/settings.gradle.kts @@ -1,11 +1,12 @@ pluginManagement { - val flutterSdkPath = run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") @@ -18,11 +19,11 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.3" apply false + id("com.android.application") version "9.0.1" apply false // START: FlutterFire Configuration - id("com.google.gms.google-services") version("4.3.15") apply false + id("com.google.gms.google-services") version("4.5.0") apply false // END: FlutterFire Configuration - id("org.jetbrains.kotlin.android") version "2.1.0" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false } include(":app") diff --git a/samples/multiplayer/codelab_rebuild.yaml b/samples/multiplayer/codelab_rebuild.yaml index a0c9571a..2a2d2d4d 100644 --- a/samples/multiplayer/codelab_rebuild.yaml +++ b/samples/multiplayer/codelab_rebuild.yaml @@ -10,6 +10,20 @@ steps: - web - name: Flutter recreate flutter: create --org com.example --project-name card --platforms android,ios,linux,macos,web . + - name: Set minimum iOS deployment target + path: ios/Runner.xcodeproj/project.pbxproj + patch-u: | + --- a/ios/Runner.xcodeproj/project.pbxproj + +++ b/ios/Runner.xcodeproj/project.pbxproj + @@ -363,1 +363,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -490,1 +490,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -541,1 +541,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; - name: Remove test/widget_test.dart rm: test/widget_test.dart - name: Patch android/app/build.gradle.kts @@ -23,9 +37,9 @@ steps: + // START: FlutterFire Configuration + id("com.google.gms.google-services") + // END: FlutterFire Configuration - id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") + } - name: Patch android/settings.gradle.kts path: android/settings.gradle.kts patch-u: | @@ -34,24 +48,12 @@ steps: @@ -19,6 +19,9 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.3" apply false + id("com.android.application") version "9.0.1" apply false + // START: FlutterFire Configuration - + id("com.google.gms.google-services") version("4.3.15") apply false + + id("com.google.gms.google-services") version("4.5.0") apply false + // END: FlutterFire Configuration - id("org.jetbrains.kotlin.android") version "2.1.0" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false } - - name: Patch ios/Podfile - path: ios/Podfile - patch-u: | - --- b/samples/multiplayer/ios/Podfile - +++ a/samples/multiplayer/ios/Podfile - @@ -1,5 +1,4 @@ - -# Uncomment this line to define a global platform for your project - -# platform :ios, '12.0' - +platform :ios, '13.0' - - # CocoaPods analytics sends network stats synchronously affecting flutter build latency. - ENV['COCOAPODS_DISABLE_STATS'] = 'true' - name: Add android/app/google-services.json path: android/app/google-services.json replace-contents: | @@ -158,7 +160,7 @@ steps: - name: Add GoogleService-Info.plist xcode-project-path: ios/Runner.xcodeproj - xcode-add-file: GoogleService-Info.plist + xcode-add-resource: GoogleService-Info.plist - name: Add macos/Runner/GoogleService-info.plist path: macos/Runner/GoogleService-info.plist replace-contents: | @@ -194,4 +196,4 @@ steps: - name: Add GoogleService-Info.plist xcode-project-path: macos/Runner.xcodeproj - xcode-add-file: GoogleService-Info.plist + xcode-add-resource: GoogleService-Info.plist diff --git a/samples/multiplayer/ios/Flutter/AppFrameworkInfo.plist b/samples/multiplayer/ios/Flutter/AppFrameworkInfo.plist index 7c569640..391a902b 100644 --- a/samples/multiplayer/ios/Flutter/AppFrameworkInfo.plist +++ b/samples/multiplayer/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/samples/multiplayer/ios/Flutter/Debug.xcconfig b/samples/multiplayer/ios/Flutter/Debug.xcconfig index ec97fc6f..592ceee8 100644 --- a/samples/multiplayer/ios/Flutter/Debug.xcconfig +++ b/samples/multiplayer/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/samples/multiplayer/ios/Flutter/Release.xcconfig b/samples/multiplayer/ios/Flutter/Release.xcconfig index c4855bfe..592ceee8 100644 --- a/samples/multiplayer/ios/Flutter/Release.xcconfig +++ b/samples/multiplayer/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/samples/multiplayer/ios/Podfile b/samples/multiplayer/ios/Podfile deleted file mode 100644 index 7eff7c93..00000000 --- a/samples/multiplayer/ios/Podfile +++ /dev/null @@ -1,42 +0,0 @@ -platform :ios, '13.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/samples/multiplayer/ios/Runner.xcodeproj/project.pbxproj b/samples/multiplayer/ios/Runner.xcodeproj/project.pbxproj index a4e1be9b..8cf2e2a9 100644 --- a/samples/multiplayer/ios/Runner.xcodeproj/project.pbxproj +++ b/samples/multiplayer/ios/Runner.xcodeproj/project.pbxproj @@ -11,10 +11,12 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - C256312A27418D3AD619C3AD /* GoogleService-Info.plist in Sources */ = {isa = PBXBuildFile; fileRef = 13F83B2B491606A7A8A9FDD9 /* GoogleService-Info.plist */; }; + EA5C2D1115F501EB7F055797 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB53AF40FD1F6B26CBEEE301 /* GoogleService-Info.plist */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -41,7 +43,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 13F83B2B491606A7A8A9FDD9 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; @@ -49,6 +50,8 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -57,6 +60,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AB53AF40FD1F6B26CBEEE301 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -64,6 +68,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -81,6 +86,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -118,8 +124,9 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - 13F83B2B491606A7A8A9FDD9 /* GoogleService-Info.plist */, + AB53AF40FD1F6B26CBEEE301 /* GoogleService-Info.plist */, ); path = Runner; sourceTree = ""; @@ -160,6 +167,9 @@ dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -193,6 +203,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -219,6 +232,7 @@ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + EA5C2D1115F501EB7F055797 /* GoogleService-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -273,7 +287,7 @@ files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - C256312A27418D3AD619C3AD /* GoogleService-Info.plist in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -350,7 +364,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -477,7 +491,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -528,7 +542,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -618,6 +632,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/samples/multiplayer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/multiplayer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..57c65e68 --- /dev/null +++ b/samples/multiplayer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,122 @@ +{ + "pins" : [ + { + "identity" : "abseil-cpp-binary", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/abseil-cpp-binary.git", + "state" : { + "revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5", + "version" : "1.2024072200.0" + } + }, + { + "identity" : "app-check", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/app-check.git", + "state" : { + "revision" : "3e33dd27dd4c69bd81c7c81fe61d8ccf58846902", + "version" : "11.3.1" + } + }, + { + "identity" : "firebase-ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/firebase-ios-sdk", + "state" : { + "revision" : "33a468adfdb75b53f05a37e7c886ca7c962b5c17", + "version" : "12.17.0" + } + }, + { + "identity" : "google-ads-on-device-conversion-ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk", + "state" : { + "revision" : "dc39082d8881109d35b94b1c122164c0e8d08a55", + "version" : "3.6.1" + } + }, + { + "identity" : "googleappmeasurement", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleAppMeasurement.git", + "state" : { + "revision" : "fceaffa07d22dcd5624d3639fd970351a4a5ad8c", + "version" : "12.17.0" + } + }, + { + "identity" : "googledatatransport", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleDataTransport.git", + "state" : { + "revision" : "ba3358d3c3dbae8ef230b58a46b97ad65e84e974", + "version" : "10.1.1" + } + }, + { + "identity" : "googleutilities", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleUtilities.git", + "state" : { + "revision" : "9f183ae842be978784f2963a343682e0c46d8fb3", + "version" : "8.1.2" + } + }, + { + "identity" : "grpc-binary", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/grpc-binary.git", + "state" : { + "revision" : "75b31c842f664a0f46a2e590a570e370249fd8f6", + "version" : "1.69.1" + } + }, + { + "identity" : "gtm-session-fetcher", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/gtm-session-fetcher.git", + "state" : { + "revision" : "c0ac7575d70050c2973ba2318bd5af47f8e8153a", + "version" : "5.3.0" + } + }, + { + "identity" : "interop-ios-for-google-sdks", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/interop-ios-for-google-sdks.git", + "state" : { + "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe", + "version" : "101.0.0" + } + }, + { + "identity" : "leveldb", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/leveldb.git", + "state" : { + "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1", + "version" : "1.22.5" + } + }, + { + "identity" : "nanopb", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/nanopb.git", + "state" : { + "revision" : "3851d94a41890dea16dc3db34caf60e585cb4163", + "version" : "2.30910.1" + } + }, + { + "identity" : "promises", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/promises.git", + "state" : { + "revision" : "f4a19a3c313dc2616c70bb49d29a799fb16be837", + "version" : "2.4.1" + } + } + ], + "version" : 2 +} diff --git a/samples/multiplayer/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/samples/multiplayer/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e3773d42..c3fedb29 100644 --- a/samples/multiplayer/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/samples/multiplayer/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/samples/multiplayer/ios/Runner/Info.plist b/samples/multiplayer/ios/Runner/Info.plist index 5a350896..5ef37251 100644 --- a/samples/multiplayer/ios/Runner/Info.plist +++ b/samples/multiplayer/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,9 +66,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/samples/multiplayer/ios/Runner/SceneDelegate.swift b/samples/multiplayer/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/samples/multiplayer/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/samples/multiplayer/lib/style/confetti.dart b/samples/multiplayer/lib/style/confetti.dart index 60a6dad7..107d1bbc 100644 --- a/samples/multiplayer/lib/style/confetti.dart +++ b/samples/multiplayer/lib/style/confetti.dart @@ -178,8 +178,7 @@ class _PaperSnipping { final paint = Paint()..style = PaintingStyle.fill; - _PaperSnipping({required this.frontColor, required Size bounds}) - : _bounds = bounds; + _PaperSnipping({required this.frontColor, required this._bounds}); void draw(Canvas canvas) { if (cosA > 0) { diff --git a/samples/multiplayer/linux/flutter/generated_plugins.cmake b/samples/multiplayer/linux/flutter/generated_plugins.cmake index e9abb912..f4bf1dcb 100644 --- a/samples/multiplayer/linux/flutter/generated_plugins.cmake +++ b/samples/multiplayer/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/samples/multiplayer/linux/runner/my_application.cc b/samples/multiplayer/linux/runner/my_application.cc index f2be3515..ff434636 100644 --- a/samples/multiplayer/linux/runner/my_application.cc +++ b/samples/multiplayer/linux/runner/my_application.cc @@ -14,6 +14,11 @@ struct _MyApplication { G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); @@ -48,31 +53,44 @@ static void my_application_activate(GApplication* application) { } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; } g_application_activate(application); @@ -83,7 +101,7 @@ static gboolean my_application_local_command_line(GApplication* application, gch // Implements GApplication::startup. static void my_application_startup(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); + // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application startup. @@ -92,7 +110,7 @@ static void my_application_startup(GApplication* application) { // Implements GApplication::shutdown. static void my_application_shutdown(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); + // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application shutdown. @@ -108,7 +126,8 @@ static void my_application_dispose(GObject* object) { static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; G_APPLICATION_CLASS(klass)->startup = my_application_startup; G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; @@ -124,7 +143,6 @@ MyApplication* my_application_new() { g_set_prgname(APPLICATION_ID); return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); } diff --git a/samples/multiplayer/linux/runner/my_application.h b/samples/multiplayer/linux/runner/my_application.h index 72271d5e..db16367a 100644 --- a/samples/multiplayer/linux/runner/my_application.h +++ b/samples/multiplayer/linux/runner/my_application.h @@ -3,7 +3,10 @@ #include -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, GtkApplication) /** diff --git a/samples/multiplayer/macos/Flutter/Flutter-Debug.xcconfig b/samples/multiplayer/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b2..c2efd0b6 100644 --- a/samples/multiplayer/macos/Flutter/Flutter-Debug.xcconfig +++ b/samples/multiplayer/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/samples/multiplayer/macos/Flutter/Flutter-Release.xcconfig b/samples/multiplayer/macos/Flutter/Flutter-Release.xcconfig index 5caa9d15..c2efd0b6 100644 --- a/samples/multiplayer/macos/Flutter/Flutter-Release.xcconfig +++ b/samples/multiplayer/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/samples/multiplayer/macos/Flutter/GeneratedPluginRegistrant.swift b/samples/multiplayer/macos/Flutter/GeneratedPluginRegistrant.swift index f6c85423..3fd2aac6 100644 --- a/samples/multiplayer/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/samples/multiplayer/macos/Flutter/GeneratedPluginRegistrant.swift @@ -8,13 +8,11 @@ import Foundation import audioplayers_darwin import cloud_firestore import firebase_core -import path_provider_foundation import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/samples/multiplayer/macos/Podfile b/samples/multiplayer/macos/Podfile deleted file mode 100644 index 29c8eb32..00000000 --- a/samples/multiplayer/macos/Podfile +++ /dev/null @@ -1,42 +0,0 @@ -platform :osx, '10.14' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/samples/multiplayer/macos/Runner.xcodeproj/project.pbxproj b/samples/multiplayer/macos/Runner.xcodeproj/project.pbxproj index 88c707a7..e61892b2 100644 --- a/samples/multiplayer/macos/Runner.xcodeproj/project.pbxproj +++ b/samples/multiplayer/macos/Runner.xcodeproj/project.pbxproj @@ -27,7 +27,8 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - C9046A15D5DB41321455845A /* GoogleService-Info.plist in Sources */ = {isa = PBXBuildFile; fileRef = FB2465E54737058D29EC103E /* GoogleService-Info.plist */; }; + 576D4782989EBBF1F2315B00 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0A9C19487C05BB896E17C470 /* GoogleService-Info.plist */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -61,11 +62,12 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0A9C19487C05BB896E17C470 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* card.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "card.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* card.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = card.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -77,9 +79,9 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - FB2465E54737058D29EC103E /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -94,6 +96,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -153,6 +156,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -170,7 +174,7 @@ 33E51914231749380026EE4D /* Release.entitlements */, 33CC11242044D66E0003C045 /* Resources */, 33BA886A226E78AF003329D5 /* Configs */, - FB2465E54737058D29EC103E /* GoogleService-Info.plist */, + 0A9C19487C05BB896E17C470 /* GoogleService-Info.plist */, ); path = Runner; sourceTree = ""; @@ -219,6 +223,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* card.app */; productType = "com.apple.product-type.application"; @@ -263,6 +270,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -288,6 +298,7 @@ files = ( 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + 576D4782989EBBF1F2315B00 /* GoogleService-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -350,7 +361,6 @@ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - C9046A15D5DB41321455845A /* GoogleService-Info.plist in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -465,7 +475,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -547,7 +557,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -597,7 +607,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -704,6 +714,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/samples/multiplayer/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/samples/multiplayer/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 9129657c..3cbb9d33 100644 --- a/samples/multiplayer/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/samples/multiplayer/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + + diff --git a/templates/basic/.metadata b/templates/basic/.metadata index 603c6412..ea0a1980 100644 --- a/templates/basic/.metadata +++ b/templates/basic/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "6fba2447e95c451518584c35e25f5433f14d888c" + revision: "058e0af2c2b57e369d905a03ac9748b0ebf543c6" channel: "stable" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: android - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: ios - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: linux - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: macos - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: web - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: windows - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 # User provided section diff --git a/templates/basic/analysis_options.yaml b/templates/basic/analysis_options.yaml index ec6411cc..94d83abc 100644 --- a/templates/basic/analysis_options.yaml +++ b/templates/basic/analysis_options.yaml @@ -1,6 +1,14 @@ include: package:flutter_lints/flutter.yaml analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** language: strict-casts: true diff --git a/templates/basic/android/app/build.gradle.kts b/templates/basic/android/app/build.gradle.kts index 6890f72e..4a8bb170 100644 --- a/templates/basic/android/app/build.gradle.kts +++ b/templates/basic/android/app/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id("com.android.application") - id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } @@ -11,12 +10,8 @@ android { ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { @@ -39,6 +34,12 @@ android { } } +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + flutter { source = "../.." } diff --git a/templates/basic/android/build.gradle.kts b/templates/basic/android/build.gradle.kts index 89176ef4..dbee657b 100644 --- a/templates/basic/android/build.gradle.kts +++ b/templates/basic/android/build.gradle.kts @@ -5,7 +5,10 @@ allprojects { } } -val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() rootProject.layout.buildDirectory.value(newBuildDir) subprojects { diff --git a/templates/basic/android/gradle.properties b/templates/basic/android/gradle.properties index f018a618..e96108cf 100644 --- a/templates/basic/android/gradle.properties +++ b/templates/basic/android/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/templates/basic/android/gradle/wrapper/gradle-wrapper.properties b/templates/basic/android/gradle/wrapper/gradle-wrapper.properties index ac3b4792..2d428bfb 100644 --- a/templates/basic/android/gradle/wrapper/gradle-wrapper.properties +++ b/templates/basic/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip diff --git a/templates/basic/android/settings.gradle.kts b/templates/basic/android/settings.gradle.kts index ab39a10a..c21f0c5b 100644 --- a/templates/basic/android/settings.gradle.kts +++ b/templates/basic/android/settings.gradle.kts @@ -1,11 +1,12 @@ pluginManagement { - val flutterSdkPath = run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") @@ -18,8 +19,8 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.3" apply false - id("org.jetbrains.kotlin.android") version "2.1.0" apply false + id("com.android.application") version "9.0.1" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false } include(":app") diff --git a/templates/basic/codelab_rebuild.yaml b/templates/basic/codelab_rebuild.yaml index 3503e1d1..f994ea45 100644 --- a/templates/basic/codelab_rebuild.yaml +++ b/templates/basic/codelab_rebuild.yaml @@ -11,6 +11,20 @@ steps: - windows - name: Flutter recreate flutter: create --org com.example --project-name basic . + - name: Set minimum iOS deployment target + path: ios/Runner.xcodeproj/project.pbxproj + patch-u: | + --- a/ios/Runner.xcodeproj/project.pbxproj + +++ b/ios/Runner.xcodeproj/project.pbxproj + @@ -363,1 +363,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -490,1 +490,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -541,1 +541,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; - name: Remove test/widget_test.dart rm: test/widget_test.dart - name: Mkdir android/app/src/main/res/mipmap-anydpi-v26 @@ -9004,4 +9018,4 @@ steps: A2Lk5Re+lStXcp2UxTBSuWC4ieTnKlQglMUfq7D0xuT43RJFRawFCv1er169XIW0bXKk3TRZG6eVD//8 wa6Uu7Qh80sDNwx5yjwKAY0rqphcnglcQYzy9JtqbPPmzUvyb9BZh1aHlNNlOTnVkafLL+D/M3Biu+QI 5CA55Ar5Ej44lA7ov3AUFeX6XPK7aaVY2unLJ0cp3v03x9/1P7f8d8ZfDO4/AI3ESKsXhZw8AAAAAElF - TkSuQmCC \ No newline at end of file + TkSuQmCC diff --git a/templates/basic/ios/Flutter/AppFrameworkInfo.plist b/templates/basic/ios/Flutter/AppFrameworkInfo.plist index 7c569640..391a902b 100644 --- a/templates/basic/ios/Flutter/AppFrameworkInfo.plist +++ b/templates/basic/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/templates/basic/ios/Flutter/Debug.xcconfig b/templates/basic/ios/Flutter/Debug.xcconfig index ec97fc6f..592ceee8 100644 --- a/templates/basic/ios/Flutter/Debug.xcconfig +++ b/templates/basic/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/templates/basic/ios/Flutter/Release.xcconfig b/templates/basic/ios/Flutter/Release.xcconfig index c4855bfe..592ceee8 100644 --- a/templates/basic/ios/Flutter/Release.xcconfig +++ b/templates/basic/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/templates/basic/ios/Podfile b/templates/basic/ios/Podfile deleted file mode 100644 index e549ee22..00000000 --- a/templates/basic/ios/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/templates/basic/ios/Runner.xcodeproj/project.pbxproj b/templates/basic/ios/Runner.xcodeproj/project.pbxproj index 12deb5c3..dd3268c6 100644 --- a/templates/basic/ios/Runner.xcodeproj/project.pbxproj +++ b/templates/basic/ios/Runner.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -47,6 +49,8 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -62,6 +66,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -79,6 +84,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -116,6 +122,7 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; @@ -157,6 +164,9 @@ dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -190,6 +200,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -270,6 +283,7 @@ files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -346,7 +360,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -472,7 +486,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -523,7 +537,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -611,6 +625,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/templates/basic/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/templates/basic/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e3773d42..c3fedb29 100644 --- a/templates/basic/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/templates/basic/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/templates/basic/ios/Runner/Info.plist b/templates/basic/ios/Runner/Info.plist index 36591141..48504a2a 100644 --- a/templates/basic/ios/Runner/Info.plist +++ b/templates/basic/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,31 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + FLTGameTemplateVersion + 1.0.0 UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,11 +68,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - FLTGameTemplateVersion - 1.0.0 diff --git a/templates/basic/ios/Runner/SceneDelegate.swift b/templates/basic/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/templates/basic/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/templates/basic/lib/style/confetti.dart b/templates/basic/lib/style/confetti.dart index 60a6dad7..107d1bbc 100644 --- a/templates/basic/lib/style/confetti.dart +++ b/templates/basic/lib/style/confetti.dart @@ -178,8 +178,7 @@ class _PaperSnipping { final paint = Paint()..style = PaintingStyle.fill; - _PaperSnipping({required this.frontColor, required Size bounds}) - : _bounds = bounds; + _PaperSnipping({required this.frontColor, required this._bounds}); void draw(Canvas canvas) { if (cosA > 0) { diff --git a/templates/basic/linux/flutter/generated_plugins.cmake b/templates/basic/linux/flutter/generated_plugins.cmake index e9abb912..f4bf1dcb 100644 --- a/templates/basic/linux/flutter/generated_plugins.cmake +++ b/templates/basic/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/templates/basic/linux/runner/my_application.cc b/templates/basic/linux/runner/my_application.cc index 694590aa..d630bffb 100644 --- a/templates/basic/linux/runner/my_application.cc +++ b/templates/basic/linux/runner/my_application.cc @@ -14,6 +14,11 @@ struct _MyApplication { G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); @@ -48,31 +53,44 @@ static void my_application_activate(GApplication* application) { } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; } g_application_activate(application); @@ -83,7 +101,7 @@ static gboolean my_application_local_command_line(GApplication* application, gch // Implements GApplication::startup. static void my_application_startup(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); + // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application startup. @@ -92,7 +110,7 @@ static void my_application_startup(GApplication* application) { // Implements GApplication::shutdown. static void my_application_shutdown(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); + // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application shutdown. @@ -108,7 +126,8 @@ static void my_application_dispose(GObject* object) { static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; G_APPLICATION_CLASS(klass)->startup = my_application_startup; G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; @@ -124,7 +143,6 @@ MyApplication* my_application_new() { g_set_prgname(APPLICATION_ID); return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); } diff --git a/templates/basic/linux/runner/my_application.h b/templates/basic/linux/runner/my_application.h index 72271d5e..db16367a 100644 --- a/templates/basic/linux/runner/my_application.h +++ b/templates/basic/linux/runner/my_application.h @@ -3,7 +3,10 @@ #include -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, GtkApplication) /** diff --git a/templates/basic/macos/Flutter/Flutter-Debug.xcconfig b/templates/basic/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b2..c2efd0b6 100644 --- a/templates/basic/macos/Flutter/Flutter-Debug.xcconfig +++ b/templates/basic/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/templates/basic/macos/Flutter/Flutter-Release.xcconfig b/templates/basic/macos/Flutter/Flutter-Release.xcconfig index 5caa9d15..c2efd0b6 100644 --- a/templates/basic/macos/Flutter/Flutter-Release.xcconfig +++ b/templates/basic/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/templates/basic/macos/Flutter/GeneratedPluginRegistrant.swift b/templates/basic/macos/Flutter/GeneratedPluginRegistrant.swift index 31657826..5d79b0bb 100644 --- a/templates/basic/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/templates/basic/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,11 +6,9 @@ import FlutterMacOS import Foundation import audioplayers_darwin -import path_provider_foundation import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/templates/basic/macos/Podfile b/templates/basic/macos/Podfile deleted file mode 100644 index 29c8eb32..00000000 --- a/templates/basic/macos/Podfile +++ /dev/null @@ -1,42 +0,0 @@ -platform :osx, '10.14' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/templates/basic/macos/Runner.xcodeproj/project.pbxproj b/templates/basic/macos/Runner.xcodeproj/project.pbxproj index 2a3f9d55..3373bd6d 100644 --- a/templates/basic/macos/Runner.xcodeproj/project.pbxproj +++ b/templates/basic/macos/Runner.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -76,6 +77,7 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ @@ -92,6 +94,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -151,6 +154,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -216,6 +220,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* basic.app */; productType = "com.apple.product-type.application"; @@ -260,6 +267,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -461,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -543,7 +553,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -593,7 +603,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -700,6 +710,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/templates/basic/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/templates/basic/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index f63c002a..f2108f01 100644 --- a/templates/basic/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/templates/basic/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + + diff --git a/templates/basic/windows/flutter/generated_plugins.cmake b/templates/basic/windows/flutter/generated_plugins.cmake index 375535c9..53f4ef88 100644 --- a/templates/basic/windows/flutter/generated_plugins.cmake +++ b/templates/basic/windows/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/templates/basic/windows/runner/Runner.rc b/templates/basic/windows/runner/Runner.rc index d8114518..428ed248 100644 --- a/templates/basic/windows/runner/Runner.rc +++ b/templates/basic/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "basic" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "basic" "\0" - VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "basic.exe" "\0" VALUE "ProductName", "basic" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/templates/basic/windows/runner/utils.cpp b/templates/basic/windows/runner/utils.cpp index 3a0b4651..3cb71466 100644 --- a/templates/basic/windows/runner/utils.cpp +++ b/templates/basic/windows/runner/utils.cpp @@ -45,13 +45,17 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } - unsigned int target_length = ::WideCharToMultiByte( + // First, find the length of the string with a safe upper bound (CWE-126). + // UNICODE_STRING_MAX_CHARS (32767) is the maximum length of a UNICODE_STRING. + int input_length = static_cast(wcsnlen(utf16_string, UNICODE_STRING_MAX_CHARS)); + // Now use that bounded length to determine the required buffer size. + // When an explicit length is passed, WideCharToMultiByte does not include + // the null terminator in its returned size. + int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr) - -1; // remove the trailing null character - int input_length = (int)wcslen(utf16_string); + input_length, nullptr, 0, nullptr, nullptr); std::string utf8_string; - if (target_length == 0 || target_length > utf8_string.max_size()) { + if (target_length == 0 || static_cast(target_length) > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); diff --git a/templates/card/.metadata b/templates/card/.metadata index 603c6412..ea0a1980 100644 --- a/templates/card/.metadata +++ b/templates/card/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "6fba2447e95c451518584c35e25f5433f14d888c" + revision: "058e0af2c2b57e369d905a03ac9748b0ebf543c6" channel: "stable" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: android - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: ios - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: linux - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: macos - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: web - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 - platform: windows - create_revision: 6fba2447e95c451518584c35e25f5433f14d888c - base_revision: 6fba2447e95c451518584c35e25f5433f14d888c + create_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 + base_revision: 058e0af2c2b57e369d905a03ac9748b0ebf543c6 # User provided section diff --git a/templates/card/analysis_options.yaml b/templates/card/analysis_options.yaml index e25b1477..23200310 100644 --- a/templates/card/analysis_options.yaml +++ b/templates/card/analysis_options.yaml @@ -1,6 +1,14 @@ include: package:flutter_lints/flutter.yaml analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** language: strict-casts: true diff --git a/templates/card/android/app/build.gradle.kts b/templates/card/android/app/build.gradle.kts index 5690d9ae..38638005 100644 --- a/templates/card/android/app/build.gradle.kts +++ b/templates/card/android/app/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id("com.android.application") - id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } @@ -11,12 +10,8 @@ android { ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { @@ -39,6 +34,12 @@ android { } } +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + flutter { source = "../.." } diff --git a/templates/card/android/build.gradle.kts b/templates/card/android/build.gradle.kts index 89176ef4..dbee657b 100644 --- a/templates/card/android/build.gradle.kts +++ b/templates/card/android/build.gradle.kts @@ -5,7 +5,10 @@ allprojects { } } -val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() rootProject.layout.buildDirectory.value(newBuildDir) subprojects { diff --git a/templates/card/android/gradle.properties b/templates/card/android/gradle.properties index f018a618..e96108cf 100644 --- a/templates/card/android/gradle.properties +++ b/templates/card/android/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/templates/card/android/gradle/wrapper/gradle-wrapper.properties b/templates/card/android/gradle/wrapper/gradle-wrapper.properties index ac3b4792..2d428bfb 100644 --- a/templates/card/android/gradle/wrapper/gradle-wrapper.properties +++ b/templates/card/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip diff --git a/templates/card/android/settings.gradle.kts b/templates/card/android/settings.gradle.kts index ab39a10a..c21f0c5b 100644 --- a/templates/card/android/settings.gradle.kts +++ b/templates/card/android/settings.gradle.kts @@ -1,11 +1,12 @@ pluginManagement { - val flutterSdkPath = run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") @@ -18,8 +19,8 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.3" apply false - id("org.jetbrains.kotlin.android") version "2.1.0" apply false + id("com.android.application") version "9.0.1" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false } include(":app") diff --git a/templates/card/codelab_rebuild.yaml b/templates/card/codelab_rebuild.yaml index ab7f2c13..8b8067c2 100644 --- a/templates/card/codelab_rebuild.yaml +++ b/templates/card/codelab_rebuild.yaml @@ -11,6 +11,20 @@ steps: - windows - name: Flutter recreate flutter: create --org com.example --project-name card . + - name: Set minimum iOS deployment target + path: ios/Runner.xcodeproj/project.pbxproj + patch-u: | + --- a/ios/Runner.xcodeproj/project.pbxproj + +++ b/ios/Runner.xcodeproj/project.pbxproj + @@ -363,1 +363,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -490,1 +490,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -541,1 +541,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; - name: Remove test/widget_test.dart rm: test/widget_test.dart - name: Patch android/app/src/main/AndroidManifest.xml diff --git a/templates/card/ios/Flutter/AppFrameworkInfo.plist b/templates/card/ios/Flutter/AppFrameworkInfo.plist index 7c569640..391a902b 100644 --- a/templates/card/ios/Flutter/AppFrameworkInfo.plist +++ b/templates/card/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/templates/card/ios/Flutter/Debug.xcconfig b/templates/card/ios/Flutter/Debug.xcconfig index ec97fc6f..592ceee8 100644 --- a/templates/card/ios/Flutter/Debug.xcconfig +++ b/templates/card/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/templates/card/ios/Flutter/Release.xcconfig b/templates/card/ios/Flutter/Release.xcconfig index c4855bfe..592ceee8 100644 --- a/templates/card/ios/Flutter/Release.xcconfig +++ b/templates/card/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/templates/card/ios/Podfile b/templates/card/ios/Podfile deleted file mode 100644 index e549ee22..00000000 --- a/templates/card/ios/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/templates/card/ios/Runner.xcodeproj/project.pbxproj b/templates/card/ios/Runner.xcodeproj/project.pbxproj index c9ed9016..0e4fc3b9 100644 --- a/templates/card/ios/Runner.xcodeproj/project.pbxproj +++ b/templates/card/ios/Runner.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -47,6 +49,8 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -62,6 +66,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -79,6 +84,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -116,6 +122,7 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; @@ -157,6 +164,9 @@ dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -190,6 +200,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -270,6 +283,7 @@ files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -346,7 +360,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -472,7 +486,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -523,7 +537,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -611,6 +625,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/templates/card/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/templates/card/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e3773d42..c3fedb29 100644 --- a/templates/card/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/templates/card/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/templates/card/ios/Runner/Info.plist b/templates/card/ios/Runner/Info.plist index d1135b42..c7b99edf 100644 --- a/templates/card/ios/Runner/Info.plist +++ b/templates/card/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,31 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + FLTGameTemplateVersion + 1.0.0 UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,11 +68,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - FLTGameTemplateVersion - 1.0.0 diff --git a/templates/card/ios/Runner/SceneDelegate.swift b/templates/card/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/templates/card/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/templates/card/lib/style/confetti.dart b/templates/card/lib/style/confetti.dart index 60a6dad7..107d1bbc 100644 --- a/templates/card/lib/style/confetti.dart +++ b/templates/card/lib/style/confetti.dart @@ -178,8 +178,7 @@ class _PaperSnipping { final paint = Paint()..style = PaintingStyle.fill; - _PaperSnipping({required this.frontColor, required Size bounds}) - : _bounds = bounds; + _PaperSnipping({required this.frontColor, required this._bounds}); void draw(Canvas canvas) { if (cosA > 0) { diff --git a/templates/card/linux/flutter/generated_plugins.cmake b/templates/card/linux/flutter/generated_plugins.cmake index e9abb912..f4bf1dcb 100644 --- a/templates/card/linux/flutter/generated_plugins.cmake +++ b/templates/card/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/templates/card/linux/runner/my_application.cc b/templates/card/linux/runner/my_application.cc index f2be3515..ff434636 100644 --- a/templates/card/linux/runner/my_application.cc +++ b/templates/card/linux/runner/my_application.cc @@ -14,6 +14,11 @@ struct _MyApplication { G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); @@ -48,31 +53,44 @@ static void my_application_activate(GApplication* application) { } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; } g_application_activate(application); @@ -83,7 +101,7 @@ static gboolean my_application_local_command_line(GApplication* application, gch // Implements GApplication::startup. static void my_application_startup(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); + // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application startup. @@ -92,7 +110,7 @@ static void my_application_startup(GApplication* application) { // Implements GApplication::shutdown. static void my_application_shutdown(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); + // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application shutdown. @@ -108,7 +126,8 @@ static void my_application_dispose(GObject* object) { static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; G_APPLICATION_CLASS(klass)->startup = my_application_startup; G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; @@ -124,7 +143,6 @@ MyApplication* my_application_new() { g_set_prgname(APPLICATION_ID); return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); } diff --git a/templates/card/linux/runner/my_application.h b/templates/card/linux/runner/my_application.h index 72271d5e..db16367a 100644 --- a/templates/card/linux/runner/my_application.h +++ b/templates/card/linux/runner/my_application.h @@ -3,7 +3,10 @@ #include -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, GtkApplication) /** diff --git a/templates/card/macos/Flutter/Flutter-Debug.xcconfig b/templates/card/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b2..c2efd0b6 100644 --- a/templates/card/macos/Flutter/Flutter-Debug.xcconfig +++ b/templates/card/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/templates/card/macos/Flutter/Flutter-Release.xcconfig b/templates/card/macos/Flutter/Flutter-Release.xcconfig index 5caa9d15..c2efd0b6 100644 --- a/templates/card/macos/Flutter/Flutter-Release.xcconfig +++ b/templates/card/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/templates/card/macos/Flutter/GeneratedPluginRegistrant.swift b/templates/card/macos/Flutter/GeneratedPluginRegistrant.swift index 31657826..5d79b0bb 100644 --- a/templates/card/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/templates/card/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,11 +6,9 @@ import FlutterMacOS import Foundation import audioplayers_darwin -import path_provider_foundation import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/templates/card/macos/Podfile b/templates/card/macos/Podfile deleted file mode 100644 index 29c8eb32..00000000 --- a/templates/card/macos/Podfile +++ /dev/null @@ -1,42 +0,0 @@ -platform :osx, '10.14' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/templates/card/macos/Runner.xcodeproj/project.pbxproj b/templates/card/macos/Runner.xcodeproj/project.pbxproj index 333e8ef6..712442e6 100644 --- a/templates/card/macos/Runner.xcodeproj/project.pbxproj +++ b/templates/card/macos/Runner.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -76,6 +77,7 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ @@ -92,6 +94,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -151,6 +154,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -216,6 +220,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* card.app */; productType = "com.apple.product-type.application"; @@ -260,6 +267,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -461,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -543,7 +553,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -593,7 +603,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -700,6 +710,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/templates/card/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/templates/card/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 9129657c..3cbb9d33 100644 --- a/templates/card/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/templates/card/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + + diff --git a/templates/card/windows/flutter/generated_plugins.cmake b/templates/card/windows/flutter/generated_plugins.cmake index 375535c9..53f4ef88 100644 --- a/templates/card/windows/flutter/generated_plugins.cmake +++ b/templates/card/windows/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/templates/card/windows/runner/Runner.rc b/templates/card/windows/runner/Runner.rc index 4e29af54..918c59d1 100644 --- a/templates/card/windows/runner/Runner.rc +++ b/templates/card/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "card" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "card" "\0" - VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "card.exe" "\0" VALUE "ProductName", "card" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/templates/card/windows/runner/utils.cpp b/templates/card/windows/runner/utils.cpp index 3a0b4651..3cb71466 100644 --- a/templates/card/windows/runner/utils.cpp +++ b/templates/card/windows/runner/utils.cpp @@ -45,13 +45,17 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } - unsigned int target_length = ::WideCharToMultiByte( + // First, find the length of the string with a safe upper bound (CWE-126). + // UNICODE_STRING_MAX_CHARS (32767) is the maximum length of a UNICODE_STRING. + int input_length = static_cast(wcsnlen(utf16_string, UNICODE_STRING_MAX_CHARS)); + // Now use that bounded length to determine the required buffer size. + // When an explicit length is passed, WideCharToMultiByte does not include + // the null terminator in its returned size. + int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr) - -1; // remove the trailing null character - int input_length = (int)wcslen(utf16_string); + input_length, nullptr, 0, nullptr, nullptr); std::string utf8_string; - if (target_length == 0 || target_length > utf8_string.max_size()) { + if (target_length == 0 || static_cast(target_length) > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); diff --git a/templates/endless_runner/analysis_options.yaml b/templates/endless_runner/analysis_options.yaml index effff94e..97b910f8 100644 --- a/templates/endless_runner/analysis_options.yaml +++ b/templates/endless_runner/analysis_options.yaml @@ -1,5 +1,13 @@ include: package:flutter_lints/flutter.yaml analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** language: strict-casts: true diff --git a/templates/endless_runner/android/app/build.gradle.kts b/templates/endless_runner/android/app/build.gradle.kts index 210868b9..714e4711 100644 --- a/templates/endless_runner/android/app/build.gradle.kts +++ b/templates/endless_runner/android/app/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id("com.android.application") - id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } @@ -11,12 +10,8 @@ android { ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { @@ -39,6 +34,12 @@ android { } } +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + flutter { source = "../.." } diff --git a/templates/endless_runner/android/build.gradle.kts b/templates/endless_runner/android/build.gradle.kts index 89176ef4..dbee657b 100644 --- a/templates/endless_runner/android/build.gradle.kts +++ b/templates/endless_runner/android/build.gradle.kts @@ -5,7 +5,10 @@ allprojects { } } -val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() rootProject.layout.buildDirectory.value(newBuildDir) subprojects { diff --git a/templates/endless_runner/android/gradle.properties b/templates/endless_runner/android/gradle.properties index f018a618..e96108cf 100644 --- a/templates/endless_runner/android/gradle.properties +++ b/templates/endless_runner/android/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/templates/endless_runner/android/gradle/wrapper/gradle-wrapper.properties b/templates/endless_runner/android/gradle/wrapper/gradle-wrapper.properties index ac3b4792..2d428bfb 100644 --- a/templates/endless_runner/android/gradle/wrapper/gradle-wrapper.properties +++ b/templates/endless_runner/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip diff --git a/templates/endless_runner/android/settings.gradle.kts b/templates/endless_runner/android/settings.gradle.kts index ab39a10a..c21f0c5b 100644 --- a/templates/endless_runner/android/settings.gradle.kts +++ b/templates/endless_runner/android/settings.gradle.kts @@ -1,11 +1,12 @@ pluginManagement { - val flutterSdkPath = run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") @@ -18,8 +19,8 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.3" apply false - id("org.jetbrains.kotlin.android") version "2.1.0" apply false + id("com.android.application") version "9.0.1" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false } include(":app") diff --git a/templates/endless_runner/codelab_rebuild.yaml b/templates/endless_runner/codelab_rebuild.yaml index 340eaf77..8d30dec1 100644 --- a/templates/endless_runner/codelab_rebuild.yaml +++ b/templates/endless_runner/codelab_rebuild.yaml @@ -11,6 +11,20 @@ steps: - windows - name: Flutter recreate flutter: create --org com.example --project-name endless_runner . + - name: Set minimum iOS deployment target + path: ios/Runner.xcodeproj/project.pbxproj + patch-u: | + --- a/ios/Runner.xcodeproj/project.pbxproj + +++ b/ios/Runner.xcodeproj/project.pbxproj + @@ -363,1 +363,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -490,1 +490,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + @@ -541,1 +541,1 @@ + - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + + IPHONEOS_DEPLOYMENT_TARGET = 15.0; - name: Remove test/widget_test.dart rm: test/widget_test.dart - name: Patch android/app/src/main/AndroidManifest.xml @@ -42,4 +56,3 @@ steps: + 1.0.0 - diff --git a/templates/endless_runner/ios/Flutter/AppFrameworkInfo.plist b/templates/endless_runner/ios/Flutter/AppFrameworkInfo.plist index 7c569640..391a902b 100644 --- a/templates/endless_runner/ios/Flutter/AppFrameworkInfo.plist +++ b/templates/endless_runner/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/templates/endless_runner/ios/Flutter/Debug.xcconfig b/templates/endless_runner/ios/Flutter/Debug.xcconfig index ec97fc6f..592ceee8 100644 --- a/templates/endless_runner/ios/Flutter/Debug.xcconfig +++ b/templates/endless_runner/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/templates/endless_runner/ios/Flutter/Release.xcconfig b/templates/endless_runner/ios/Flutter/Release.xcconfig index c4855bfe..592ceee8 100644 --- a/templates/endless_runner/ios/Flutter/Release.xcconfig +++ b/templates/endless_runner/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/templates/endless_runner/ios/Podfile b/templates/endless_runner/ios/Podfile deleted file mode 100644 index e549ee22..00000000 --- a/templates/endless_runner/ios/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/templates/endless_runner/ios/Runner.xcodeproj/project.pbxproj b/templates/endless_runner/ios/Runner.xcodeproj/project.pbxproj index 77bf5a56..08461586 100644 --- a/templates/endless_runner/ios/Runner.xcodeproj/project.pbxproj +++ b/templates/endless_runner/ios/Runner.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -47,6 +49,8 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -62,6 +66,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -79,6 +84,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -116,6 +122,7 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; @@ -157,6 +164,9 @@ dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -190,6 +200,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -270,6 +283,7 @@ files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -346,7 +360,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -472,7 +486,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -523,7 +537,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -611,6 +625,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/templates/endless_runner/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/templates/endless_runner/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e3773d42..c3fedb29 100644 --- a/templates/endless_runner/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/templates/endless_runner/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/templates/endless_runner/ios/Runner/Info.plist b/templates/endless_runner/ios/Runner/Info.plist index 68b11da0..1e6afbcd 100644 --- a/templates/endless_runner/ios/Runner/Info.plist +++ b/templates/endless_runner/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,31 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + FLTGameTemplateVersion + 1.0.0 UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,11 +68,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - FLTGameTemplateVersion - 1.0.0 diff --git a/templates/endless_runner/ios/Runner/SceneDelegate.swift b/templates/endless_runner/ios/Runner/SceneDelegate.swift new file mode 100644 index 00000000..b9ce8ea2 --- /dev/null +++ b/templates/endless_runner/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/templates/endless_runner/linux/flutter/generated_plugins.cmake b/templates/endless_runner/linux/flutter/generated_plugins.cmake index e9abb912..f4bf1dcb 100644 --- a/templates/endless_runner/linux/flutter/generated_plugins.cmake +++ b/templates/endless_runner/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/templates/endless_runner/linux/runner/my_application.cc b/templates/endless_runner/linux/runner/my_application.cc index 11804f80..8a52537f 100644 --- a/templates/endless_runner/linux/runner/my_application.cc +++ b/templates/endless_runner/linux/runner/my_application.cc @@ -14,6 +14,11 @@ struct _MyApplication { G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); @@ -48,31 +53,44 @@ static void my_application_activate(GApplication* application) { } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; } g_application_activate(application); @@ -83,7 +101,7 @@ static gboolean my_application_local_command_line(GApplication* application, gch // Implements GApplication::startup. static void my_application_startup(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); + // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application startup. @@ -92,7 +110,7 @@ static void my_application_startup(GApplication* application) { // Implements GApplication::shutdown. static void my_application_shutdown(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); + // MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application shutdown. @@ -108,7 +126,8 @@ static void my_application_dispose(GObject* object) { static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; G_APPLICATION_CLASS(klass)->startup = my_application_startup; G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; @@ -124,7 +143,6 @@ MyApplication* my_application_new() { g_set_prgname(APPLICATION_ID); return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); } diff --git a/templates/endless_runner/linux/runner/my_application.h b/templates/endless_runner/linux/runner/my_application.h index 72271d5e..db16367a 100644 --- a/templates/endless_runner/linux/runner/my_application.h +++ b/templates/endless_runner/linux/runner/my_application.h @@ -3,7 +3,10 @@ #include -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, GtkApplication) /** diff --git a/templates/endless_runner/macos/Flutter/Flutter-Debug.xcconfig b/templates/endless_runner/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b2..c2efd0b6 100644 --- a/templates/endless_runner/macos/Flutter/Flutter-Debug.xcconfig +++ b/templates/endless_runner/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/templates/endless_runner/macos/Flutter/Flutter-Release.xcconfig b/templates/endless_runner/macos/Flutter/Flutter-Release.xcconfig index 5caa9d15..c2efd0b6 100644 --- a/templates/endless_runner/macos/Flutter/Flutter-Release.xcconfig +++ b/templates/endless_runner/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/templates/endless_runner/macos/Flutter/GeneratedPluginRegistrant.swift b/templates/endless_runner/macos/Flutter/GeneratedPluginRegistrant.swift index 31657826..5d79b0bb 100644 --- a/templates/endless_runner/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/templates/endless_runner/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,11 +6,9 @@ import FlutterMacOS import Foundation import audioplayers_darwin -import path_provider_foundation import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/templates/endless_runner/macos/Podfile b/templates/endless_runner/macos/Podfile deleted file mode 100644 index 29c8eb32..00000000 --- a/templates/endless_runner/macos/Podfile +++ /dev/null @@ -1,42 +0,0 @@ -platform :osx, '10.14' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/templates/endless_runner/macos/Runner.xcodeproj/project.pbxproj b/templates/endless_runner/macos/Runner.xcodeproj/project.pbxproj index bbc9fad3..14e07831 100644 --- a/templates/endless_runner/macos/Runner.xcodeproj/project.pbxproj +++ b/templates/endless_runner/macos/Runner.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -76,6 +77,7 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ @@ -92,6 +94,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -151,6 +154,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, @@ -216,6 +220,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* endless_runner.app */; productType = "com.apple.product-type.application"; @@ -260,6 +267,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -461,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -543,7 +553,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -593,7 +603,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -700,6 +710,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/templates/endless_runner/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/templates/endless_runner/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 40e66d32..9faab63e 100644 --- a/templates/endless_runner/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/templates/endless_runner/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + + diff --git a/templates/endless_runner/windows/flutter/generated_plugins.cmake b/templates/endless_runner/windows/flutter/generated_plugins.cmake index 375535c9..53f4ef88 100644 --- a/templates/endless_runner/windows/flutter/generated_plugins.cmake +++ b/templates/endless_runner/windows/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/templates/endless_runner/windows/runner/Runner.rc b/templates/endless_runner/windows/runner/Runner.rc index e76f4754..7899b1ee 100644 --- a/templates/endless_runner/windows/runner/Runner.rc +++ b/templates/endless_runner/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "endless_runner" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "endless_runner" "\0" - VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "endless_runner.exe" "\0" VALUE "ProductName", "endless_runner" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/templates/endless_runner/windows/runner/utils.cpp b/templates/endless_runner/windows/runner/utils.cpp index 3a0b4651..3cb71466 100644 --- a/templates/endless_runner/windows/runner/utils.cpp +++ b/templates/endless_runner/windows/runner/utils.cpp @@ -45,13 +45,17 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } - unsigned int target_length = ::WideCharToMultiByte( + // First, find the length of the string with a safe upper bound (CWE-126). + // UNICODE_STRING_MAX_CHARS (32767) is the maximum length of a UNICODE_STRING. + int input_length = static_cast(wcsnlen(utf16_string, UNICODE_STRING_MAX_CHARS)); + // Now use that bounded length to determine the required buffer size. + // When an explicit length is passed, WideCharToMultiByte does not include + // the null terminator in its returned size. + int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr) - -1; // remove the trailing null character - int input_length = (int)wcslen(utf16_string); + input_length, nullptr, 0, nullptr, nullptr); std::string utf8_string; - if (target_length == 0 || target_length > utf8_string.max_size()) { + if (target_length == 0 || static_cast(target_length) > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); From cb779762cc4aa146717f3b81bded65f853e07078 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Mon, 3 Aug 2026 13:53:37 -0500 Subject: [PATCH 2/3] Work around dart format looking into build folder --- flutter_ci_script_shared.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flutter_ci_script_shared.sh b/flutter_ci_script_shared.sh index 2842c945..d449fe63 100755 --- a/flutter_ci_script_shared.sh +++ b/flutter_ci_script_shared.sh @@ -14,8 +14,9 @@ function ci_projects () { # Run the analyzer to find any static analysis issues. dart analyze --fatal-infos - # Run the formatter on all the dart files to make sure everything's linted. - dart format --output none --set-exit-if-changed . + # Run the formatter only on Git-tracked Dart files.. + git ls-files -z -- '*.dart' | + xargs -0 dart format --output none --set-exit-if-changed # Run the actual tests. if [ -d "test" ] From 0443954cd6f08b22a5218954e821506066afb41f Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Mon, 3 Aug 2026 13:53:57 -0500 Subject: [PATCH 3/3] Remove extra period --- flutter_ci_script_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter_ci_script_shared.sh b/flutter_ci_script_shared.sh index d449fe63..12c0f2ad 100755 --- a/flutter_ci_script_shared.sh +++ b/flutter_ci_script_shared.sh @@ -14,7 +14,7 @@ function ci_projects () { # Run the analyzer to find any static analysis issues. dart analyze --fatal-infos - # Run the formatter only on Git-tracked Dart files.. + # Run the formatter only on Git-tracked Dart files. git ls-files -z -- '*.dart' | xargs -0 dart format --output none --set-exit-if-changed