From e17694030443c6f12ea0c9ae099b191974ce93a4 Mon Sep 17 00:00:00 2001 From: Vinzent Date: Tue, 10 Sep 2024 23:52:31 +0200 Subject: [PATCH] fix: update example native code --- packages/supabase_flutter/example/.metadata | 34 +++++----- .../example/analysis_options.yaml | 3 +- .../example/android/.gitignore | 2 +- .../example/android/app/build.gradle | 65 ++++++------------- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 17 ++++- .../com/example/example/MainActivity.kt | 3 +- .../app/src/profile/AndroidManifest.xml | 3 +- .../example/android/build.gradle | 19 +----- .../example/android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- .../example/android/settings.gradle | 30 ++++++--- .../example/ios/RunnerTests/RunnerTests.swift | 12 ++++ .../macos/RunnerTests/RunnerTests.swift | 12 ++++ .../supabase_flutter/example/web/index.html | 22 +------ 15 files changed, 107 insertions(+), 123 deletions(-) create mode 100644 packages/supabase_flutter/example/ios/RunnerTests/RunnerTests.swift create mode 100644 packages/supabase_flutter/example/macos/RunnerTests/RunnerTests.swift diff --git a/packages/supabase_flutter/example/.metadata b/packages/supabase_flutter/example/.metadata index 48c6a020..391c336b 100644 --- a/packages/supabase_flutter/example/.metadata +++ b/packages/supabase_flutter/example/.metadata @@ -1,11 +1,11 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled. +# This file should be version controlled and should not be manually edited. version: - revision: 676cefaaff197f27424942307668886253e1ec35 - channel: stable + revision: "5874a72aa4c779a02553007c47dacbefba2374dc" + channel: "stable" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: 676cefaaff197f27424942307668886253e1ec35 - base_revision: 676cefaaff197f27424942307668886253e1ec35 + create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc + base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - platform: android - create_revision: 676cefaaff197f27424942307668886253e1ec35 - base_revision: 676cefaaff197f27424942307668886253e1ec35 + create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc + base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - platform: ios - create_revision: 676cefaaff197f27424942307668886253e1ec35 - base_revision: 676cefaaff197f27424942307668886253e1ec35 + create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc + base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - platform: linux - create_revision: 676cefaaff197f27424942307668886253e1ec35 - base_revision: 676cefaaff197f27424942307668886253e1ec35 + create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc + base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - platform: macos - create_revision: 676cefaaff197f27424942307668886253e1ec35 - base_revision: 676cefaaff197f27424942307668886253e1ec35 + create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc + base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - platform: web - create_revision: 676cefaaff197f27424942307668886253e1ec35 - base_revision: 676cefaaff197f27424942307668886253e1ec35 + create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc + base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc - platform: windows - create_revision: 676cefaaff197f27424942307668886253e1ec35 - base_revision: 676cefaaff197f27424942307668886253e1ec35 + create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc + base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc # User provided section diff --git a/packages/supabase_flutter/example/analysis_options.yaml b/packages/supabase_flutter/example/analysis_options.yaml index 1bd3ae32..f1394e4f 100644 --- a/packages/supabase_flutter/example/analysis_options.yaml +++ b/packages/supabase_flutter/example/analysis_options.yaml @@ -26,8 +26,7 @@ linter: # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule analyzer: - exclude: + exclude: - lib/generated_plugin_registrant.dart - # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/packages/supabase_flutter/example/android/.gitignore b/packages/supabase_flutter/example/android/.gitignore index 6f568019..55afd919 100644 --- a/packages/supabase_flutter/example/android/.gitignore +++ b/packages/supabase_flutter/example/android/.gitignore @@ -7,7 +7,7 @@ gradle-wrapper.jar GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/packages/supabase_flutter/example/android/app/build.gradle b/packages/supabase_flutter/example/android/app/build.gradle index 0833ecfc..b5511a9a 100644 --- a/packages/supabase_flutter/example/android/app/build.gradle +++ b/packages/supabase_flutter/example/android/app/build.gradle @@ -1,71 +1,44 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - 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') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' +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" } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion + namespace = "com.example.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + jvmTarget = JavaVersion.VERSION_1_8 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.example" + applicationId = "com.example.example" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig = signingConfigs.debug } } } flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + source = "../.." } diff --git a/packages/supabase_flutter/example/android/app/src/debug/AndroidManifest.xml b/packages/supabase_flutter/example/android/app/src/debug/AndroidManifest.xml index 45d523a2..399f6981 100644 --- a/packages/supabase_flutter/example/android/app/src/debug/AndroidManifest.xml +++ b/packages/supabase_flutter/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + + + + + + + diff --git a/packages/supabase_flutter/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/packages/supabase_flutter/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt index e793a000..70f8f08f 100644 --- a/packages/supabase_flutter/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt +++ b/packages/supabase_flutter/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -2,5 +2,4 @@ package com.example.example import io.flutter.embedding.android.FlutterActivity -class MainActivity: FlutterActivity() { -} +class MainActivity: FlutterActivity() diff --git a/packages/supabase_flutter/example/android/app/src/profile/AndroidManifest.xml b/packages/supabase_flutter/example/android/app/src/profile/AndroidManifest.xml index 45d523a2..399f6981 100644 --- a/packages/supabase_flutter/example/android/app/src/profile/AndroidManifest.xml +++ b/packages/supabase_flutter/example/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - + - - +