From 07e64d018748c077af5d9a3f853e5f6d1a071c36 Mon Sep 17 00:00:00 2001 From: Abestanis Date: Sun, 30 Jun 2024 18:50:57 +0200 Subject: [PATCH] Update Flutter version --- .fvm/fvm_config.json | 2 +- .fvmrc | 2 +- .github/workflows/build_executables.yml | 2 +- .../workflows/deploy_google_play/action.yml | 2 +- .github/workflows/test/action.yml | 2 +- .gitignore | 61 +- .metadata | 39 +- android/.gitignore | 13 + android/app/build.gradle | 90 ++- android/app/src/debug/AndroidManifest.xml | 3 +- android/app/src/main/AndroidManifest.xml | 22 +- .../com/nt4f04und/sweyer/MainActivity.kt | 2 +- .../res/drawable-v21/launch_background.xml | 11 + .../app/src/main/res/values-night/styles.xml | 23 + android/app/src/main/res/values/styles.xml | 2 +- android/app/src/profile/AndroidManifest.xml | 3 +- android/build.gradle | 21 +- android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- android/settings.gradle | 34 +- .../material_app_switches_state.freezed.dart | 74 ++- lib/logic/control.dart | 2 +- lib/routes/home_route/player_route.dart | 4 +- lib/routes/home_route/search_route.dart | 6 +- lib/widgets/buttons.dart | 8 +- lib/widgets/show_functions.dart | 4 +- lib/widgets/text_field.dart | 2 +- pubspec.lock | 598 +++++++++--------- pubspec.yaml | 52 +- sweyer_plugin/.gitignore | 1 - sweyer_plugin/.metadata | 14 +- sweyer_plugin/android/build.gradle | 52 +- sweyer_plugin/example/.gitignore | 4 - .../example/android/app/build.gradle | 65 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 17 +- .../app/src/profile/AndroidManifest.xml | 3 +- sweyer_plugin/example/android/build.gradle | 19 +- .../example/android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- sweyer_plugin/example/android/settings.gradle | 30 +- sweyer_plugin/example/pubspec.lock | 179 ++++-- sweyer_plugin/example/pubspec.yaml | 11 +- .../lib/sweyer_plugin_platform_interface.dart | 2 +- sweyer_plugin/pubspec.yaml | 10 +- .../sweyer_plugin_method_channel_test.dart | 15 +- sweyer_plugin/test/sweyer_plugin_test.dart | 5 +- test/fakes/fake_just_audio.dart | 12 + 48 files changed, 874 insertions(+), 662 deletions(-) create mode 100644 android/.gitignore create mode 100644 android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 android/app/src/main/res/values-night/styles.xml diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index 27e335495..b2dc994ca 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,4 +1,4 @@ { - "flutterSdkVersion": "3.7.12", + "flutterSdkVersion": "3.22.2", "flavors": {} } \ No newline at end of file diff --git a/.fvmrc b/.fvmrc index 2b1932349..26d017c2b 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,4 +1,4 @@ { - "flutter": "3.7.12", + "flutter": "3.22.2", "flavors": {} } \ No newline at end of file diff --git a/.github/workflows/build_executables.yml b/.github/workflows/build_executables.yml index 61df481f2..bdb7aeaaa 100644 --- a/.github/workflows/build_executables.yml +++ b/.github/workflows/build_executables.yml @@ -12,7 +12,7 @@ jobs: - name: 🐦 Setup Flutter uses: subosito/flutter-action@v2 with: - flutter-version: 3.7.12 + flutter-version: 3.22.2 channel: stable cache: true diff --git a/.github/workflows/deploy_google_play/action.yml b/.github/workflows/deploy_google_play/action.yml index 47518974c..4df254e33 100644 --- a/.github/workflows/deploy_google_play/action.yml +++ b/.github/workflows/deploy_google_play/action.yml @@ -8,7 +8,7 @@ inputs: description: The channel of the Flutter used to build Sweyer with. flutter_version: required: false - default: "3.7.12" + default: "3.22.2" description: The version of Flutter used to build Sweyer with. ruby_version: required: false diff --git a/.github/workflows/test/action.yml b/.github/workflows/test/action.yml index 47d96a6d9..2e279796d 100644 --- a/.github/workflows/test/action.yml +++ b/.github/workflows/test/action.yml @@ -11,7 +11,7 @@ inputs: description: The channel of the Flutter used to build Sweyer with. flutter_version: required: false - default: "3.7.12" + default: "3.22.2" description: The version of Flutter used to build Sweyer with. testing_arguments: required: false diff --git a/.gitignore b/.gitignore index 4d94e57c2..846b1ad6b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ .buildlog/ .history .svn/ +migrate_working_dir/ # IntelliJ related *.iml @@ -23,62 +24,24 @@ # Flutter/Dart/Pub related **/doc/api/ +**/ios/Flutter/.last_build_id .dart_tool/ .flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/ephemeral -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* -**/ios/Flutter/flutter_export_environment.sh - -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages - -# Ignore key props -key.properties -**/*.keystore -**/*.jks +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release # gen_l10n untranslated messages output, see l10n.yaml untranslated-messages.txt diff --git a/.metadata b/.metadata index e0236519d..cbf1dc0e0 100644 --- a/.metadata +++ b/.metadata @@ -4,7 +4,42 @@ # This file should be version controlled and should not be manually edited. version: - revision: 20e59316b8b8474554b38493b8ca888794b0234a - channel: stable + revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: android + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: ios + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: linux + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: macos + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: web + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: windows + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle b/android/app/build.gradle index 434592905..f5e994958 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,88 +1,76 @@ +plugins { + id "com.android.application" + // START: FlutterFire Configuration + id 'com.google.gms.google-services' + id 'com.google.firebase.crashlytics' + // 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" +} + def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') +def localPropertiesFile = rootProject.file("local.properties") if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> + localPropertiesFile.withReader("UTF-8") { reader -> localProperties.load(reader) } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +def flutterVersionCode = localProperties.getProperty("flutter.versionCode") if (flutterVersionCode == null) { - flutterVersionCode = '1' + flutterVersionCode = "1" } -def flutterVersionName = localProperties.getProperty('flutter.versionName') +def flutterVersionName = localProperties.getProperty("flutter.versionName") if (flutterVersionName == null) { - flutterVersionName = '1.0' + flutterVersionName = "1.0" } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" -apply plugin: 'com.google.gms.google-services' // Google Services plugin -apply plugin: 'com.google.firebase.crashlytics' - def keystoreProperties = new Properties() -def keystorePropertiesFile = rootProject.file('key.properties') +def keystorePropertiesFile = rootProject.file("key.properties") if (keystorePropertiesFile.exists()) { - keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + keystorePropertiesFile.withReader("UTF-8") { reader -> + keystoreProperties.load(reader) + } } android { - compileSdkVersion 33 // flutter.compileSdkVersion + namespace = "com.nt4f04und.sweyer" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } defaultConfig { - applicationId "com.nt4f04und.sweyer" - minSdkVersion Math.max(21, flutter.minSdkVersion) - targetSdkVersion 33 // flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + applicationId = "com.nt4f04und.sweyer" + minSdk = Math.max(21, flutter.minSdkVersion) + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName } signingConfigs { release { - keyAlias keystoreProperties['keyAlias'] - keyPassword keystoreProperties['keyPassword'] - storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null - storePassword keystoreProperties['storePassword'] + keyAlias = keystoreProperties['keyAlias'] + keyPassword = keystoreProperties['keyPassword'] + storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword = keystoreProperties['storePassword'] } } buildTypes { release { - minifyEnabled true - shrinkResources true - signingConfig signingConfigs.release - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + minifyEnabled = true + shrinkResources = true + signingConfig = signingConfigs.release } } - namespace 'com.nt4f04und.sweyer' } flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.google.firebase:firebase-crashlytics:17.4.1' - implementation 'com.google.firebase:firebase-analytics:18.0.3' + source = "../.." } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index f880684a6..399f6981d 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,6 @@ - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index b2634abfa..4fc1a858a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + xmlns:tools="http://schemas.android.com/tools"> @@ -7,6 +7,7 @@ + + android:resource="@style/NormalTheme" + /> @@ -55,7 +58,9 @@ android:value="2" /> + android:exported="true" + android:foregroundServiceType="mediaPlayback" + tools:ignore="Instantiatable"> @@ -68,4 +73,15 @@ + + + + + + + diff --git a/android/app/src/main/kotlin/com/nt4f04und/sweyer/MainActivity.kt b/android/app/src/main/kotlin/com/nt4f04und/sweyer/MainActivity.kt index eda6f8322..c052f8b70 100644 --- a/android/app/src/main/kotlin/com/nt4f04und/sweyer/MainActivity.kt +++ b/android/app/src/main/kotlin/com/nt4f04und/sweyer/MainActivity.kt @@ -2,4 +2,4 @@ package com.nt4f04und.sweyer import com.ryanheise.audioservice.AudioServiceActivity -class MainActivity : AudioServiceActivity() +class MainActivity: AudioServiceActivity() diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..b303a46b4 --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..70c5f6a4e --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,23 @@ + + + #7c4dff + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 441494008..70c5f6a4e 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -4,7 +4,7 @@