From 8b9191474066badc0c6fb65fa7961e1e4b9800bd Mon Sep 17 00:00:00 2001 From: Shakle Date: Tue, 23 Dec 2025 00:30:15 +0100 Subject: [PATCH 1/9] clean up dart part --- analysis_options.yaml | 5 +++- example/pubspec.lock | 12 ++++----- lib/src/custom_proxy.dart | 4 +-- lib/src/native_proxy_reader.dart | 4 +-- pubspec.lock | 42 ++++++++++++++++---------------- pubspec.yaml | 8 +++--- 6 files changed, 39 insertions(+), 36 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index f17506e..03bae08 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -5,4 +5,7 @@ formatter: linter: rules: - lines_longer_than_80_chars: false \ No newline at end of file + lines_longer_than_80_chars: false + prefer_const_constructors: true + prefer_const_declarations: true + prefer_const_literals_to_create_immutables: true diff --git a/example/pubspec.lock b/example/pubspec.lock index 8cfd740..a0a4db8 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -34,17 +34,17 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" native_flutter_proxy: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.2.0" + version: "0.3.0" sky_engine: dependency: transitive description: flutter @@ -54,10 +54,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" very_good_analysis: dependency: "direct dev" description: @@ -67,4 +67,4 @@ packages: source: hosted version: "5.1.0" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.8.0-0 <4.0.0" diff --git a/lib/src/custom_proxy.dart b/lib/src/custom_proxy.dart index a22590e..efa3991 100644 --- a/lib/src/custom_proxy.dart +++ b/lib/src/custom_proxy.dart @@ -71,8 +71,8 @@ class CustomProxy { // Split the proxy string into parts and extract the IP address and port number if available // Format: "ipAddress:port" final proxyParts = proxy.split(':'); - final ipAddress = proxyParts[0]; - final port = proxyParts.isNotEmpty ? int.tryParse(proxyParts[1]) : null; + final ipAddress = proxyParts.first; + final port = proxyParts.length > 1 ? int.tryParse(proxyParts[1]) : null; return CustomProxy(ipAddress: ipAddress, port: port); } diff --git a/lib/src/native_proxy_reader.dart b/lib/src/native_proxy_reader.dart index 042cc00..188bd6f 100644 --- a/lib/src/native_proxy_reader.dart +++ b/lib/src/native_proxy_reader.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/services.dart'; -/// {@template custom_proxy} +/// {@template native_proxy_reader} /// A class to read network proxy settings from native platform code. /// /// This class provides functionality to retrieve proxy settings like host and @@ -18,7 +18,7 @@ import 'package:flutter/services.dart'; /// ``` /// {@endtemplate} abstract final class NativeProxyReader { - /// Method channel for native platform communication.ƒ + /// Method channel for native platform communication. static const _channel = MethodChannel('native_flutter_proxy'); /// Get the proxy settings from the native platform. diff --git a/pubspec.lock b/pubspec.lock index 939a55c..83770f8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -63,26 +63,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" matcher: dependency: transitive description: @@ -103,10 +103,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" path: dependency: transitive description: @@ -164,34 +164,34 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.7" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" very_good_analysis: dependency: "direct dev" description: name: very_good_analysis - sha256: "62d2b86d183fb81b2edc22913d9f155d26eb5cf3855173adb1f59fac85035c63" + sha256: "96245839dbcc45dfab1af5fa551603b5c7a282028a64746c19c547d21a7f1e3a" url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "10.0.0" vm_service: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.2" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.9.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index dc2294f..b4e3ea3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: native_flutter_proxy description: A flutter plugin to read and set network proxy info from native. -version: 0.2.3 +version: 0.3.0 homepage: https://github.com/victorblaess/native_flutter_proxy environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.0.0" + sdk: ^3.0.0 + flutter: ^3.0.0 dependencies: flutter: @@ -14,7 +14,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - very_good_analysis: ^7.0.0 + very_good_analysis: ^10.0.0 flutter: plugin: From d4f52fe1a68e2bacdad391cf5ea63e631dca35ed Mon Sep 17 00:00:00 2001 From: Shakle Date: Tue, 23 Dec 2025 00:32:20 +0100 Subject: [PATCH 2/9] clean up example --- example/pubspec.lock | 6 +++--- example/pubspec.yaml | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index a0a4db8..8770eaa 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -62,9 +62,9 @@ packages: dependency: "direct dev" description: name: very_good_analysis - sha256: "9ae7f3a3bd5764fb021b335ca28a34f040cd0ab6eec00a1b213b445dae58a4b8" + sha256: "96245839dbcc45dfab1af5fa551603b5c7a282028a64746c19c547d21a7f1e3a" url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "10.0.0" sdks: - dart: ">=3.8.0-0 <4.0.0" + dart: ">=3.9.0 <4.0.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 9539dc3..ff01f30 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,15 +4,16 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.0.0 dependencies: flutter: sdk: flutter - native_flutter_proxy: ^0.2.0 + native_flutter_proxy: + path: ../ dev_dependencies: - very_good_analysis: ^5.1.0 + very_good_analysis: ^10.0.0 flutter: uses-material-design: true From c5098da970de3a17001bc1d0d13d3feca49ff13d Mon Sep 17 00:00:00 2001 From: Shakle Date: Wed, 24 Dec 2025 17:53:06 +0100 Subject: [PATCH 3/9] update gradle --- analysis_options.yaml | 1 + android/build.gradle.kts | 25 +++++++++---------- android/gradle.properties | 2 -- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle.kts | 24 ++++++++++++------ example/android/app/build.gradle | 7 ++---- example/lib/main.dart | 3 +-- 7 files changed, 34 insertions(+), 30 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 03bae08..55e5184 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -9,3 +9,4 @@ linter: prefer_const_constructors: true prefer_const_declarations: true prefer_const_literals_to_create_immutables: true + avoid_catches_without_on_clauses: false diff --git a/android/build.gradle.kts b/android/build.gradle.kts index de7e157..f0c3e1b 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,8 +1,10 @@ -val kotlinVersion: String by project +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") + 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") } allprojects { @@ -17,22 +19,18 @@ group = "com.victorblaess.native_flutter_proxy" android { namespace = "com.victorblaess.native_flutter_proxy" - ndkVersion = "26.3.11579264" - compileSdk = 35 + ndkVersion = "27.3.13750724" + compileSdk = 36 compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() - } - sourceSets["main"].java.srcDirs("src/main/kotlin") defaultConfig { - minSdk = 16 + minSdk = flutter.minSdkVersion testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -41,7 +39,8 @@ android { } } -dependencies { - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") +kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } } diff --git a/android/gradle.properties b/android/gradle.properties index 2fc4dad..94adc3a 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,3 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -agpVersion=8.7.0 -kotlinVersion=1.8.22 \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 3718116..a807037 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ #Thu Mar 27 10:21:41 CET 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index c601fd0..82d65b0 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -1,16 +1,26 @@ pluginManagement { - val agpVersion: String by settings - val kotlinVersion: String by settings + 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") repositories { - gradlePluginPortal() google() mavenCentral() + gradlePluginPortal() } - plugins { - id("com.android.library") version agpVersion - id("org.jetbrains.kotlin.android") version kotlinVersion - } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.13.2" apply false + id("org.jetbrains.kotlin.android") version "2.3.0" apply false } rootProject.name = "native_flutter_proxy" diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 69135ec..99076e7 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -28,7 +28,7 @@ if (flutterVersionName == null) { } android { - compileSdkVersion 34 + compileSdkVersion 36 compileOptions { sourceCompatibility JavaVersion.VERSION_17 @@ -40,18 +40,15 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.veebee.proxy.example.example" minSdkVersion flutter.minSdkVersion - targetSdkVersion 30 + targetSdkVersion 36 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } 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 } } diff --git a/example/lib/main.dart b/example/lib/main.dart index 5df3952..1e4c128 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,4 +1,3 @@ -// ignore_for_file: unused_local_variable import 'package:flutter/material.dart'; import 'package:native_flutter_proxy/native_flutter_proxy.dart'; @@ -24,7 +23,7 @@ void main() async { // Enable the proxy if it is enabled and the host is not null. if (enabled && host != null) { - final proxy = CustomProxy(ipAddress: host, port: port).enable(); + CustomProxy(ipAddress: host, port: port).enable(); debugPrint('proxy enabled'); } From 6a27bb3c65028aea543d31382ae72869a635f92e Mon Sep 17 00:00:00 2001 From: Shakle Date: Wed, 24 Dec 2025 19:42:39 +0100 Subject: [PATCH 4/9] first working version --- android/build.gradle.kts | 7 +- android/settings.gradle.kts | 2 +- example/.gitignore | 9 +- example/.metadata | 27 ++- example/README.md | 10 +- example/analysis_options.yaml | 9 +- example/android/.gitignore | 5 +- example/android/app/build.gradle | 63 ------ example/android/app/build.gradle.kts | 43 ++++ .../android/app/src/debug/AndroidManifest.xml | 6 +- .../android/app/src/main/AndroidManifest.xml | 28 ++- .../com/example/example/MainActivity.kt | 5 + .../proxy/example/example/MainActivity.kt | 6 - .../app/src/main/res/values-night/styles.xml | 4 +- .../app/src/main/res/values/styles.xml | 4 +- .../app/src/profile/AndroidManifest.xml | 6 +- example/android/build.gradle | 19 -- example/android/build.gradle.kts | 24 ++ example/android/gradle.properties | 5 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- example/android/settings.gradle | 25 --- example/android/settings.gradle.kts | 26 +++ example/ios/.gitignore | 1 + example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Podfile | 6 +- example/ios/Podfile.lock | 22 -- example/ios/Runner.xcodeproj/project.pbxproj | 208 ++++++++++++------ .../xcshareddata/xcschemes/Runner.xcscheme | 24 +- .../contents.xcworkspacedata | 3 - example/ios/Runner/AppDelegate.swift | 4 +- .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 564 -> 295 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 1283 -> 406 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 1588 -> 450 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 1025 -> 282 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 1716 -> 462 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 1920 -> 704 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 1283 -> 406 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 1895 -> 586 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 2665 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 2665 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 3831 -> 1674 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 1888 -> 762 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 3294 -> 1226 bytes .../Icon-App-83.5x83.5@2x.png | Bin 3612 -> 1418 bytes example/ios/Runner/Info.plist | 8 +- example/ios/RunnerTests/RunnerTests.swift | 12 + example/lib/app.dart | 70 ++++++ example/lib/data/models/proxy_info.dart | 46 ++++ example/lib/main.dart | 97 ++------ example/lib/view/screens/proxy_screen.dart | 125 +++++++++++ .../view/widgets/decorated_background.dart | 68 ++++++ example/lib/view/widgets/error_panel.dart | 36 +++ example/lib/view/widgets/footer_note.dart | 21 ++ example/lib/view/widgets/header_section.dart | 53 +++++ example/lib/view/widgets/info_pill.dart | 58 +++++ example/lib/view/widgets/status_card.dart | 83 +++++++ example/lib/view/widgets/status_dot.dart | 27 +++ example/pubspec.lock | 162 +++++++++++++- example/pubspec.yaml | 45 +++- example/pubspec_overrides.yaml | 3 - 60 files changed, 1165 insertions(+), 356 deletions(-) delete mode 100644 example/android/app/build.gradle create mode 100644 example/android/app/build.gradle.kts create mode 100644 example/android/app/src/main/kotlin/com/example/example/MainActivity.kt delete mode 100644 example/android/app/src/main/kotlin/com/veebee/proxy/example/example/MainActivity.kt delete mode 100644 example/android/build.gradle create mode 100644 example/android/build.gradle.kts delete mode 100644 example/android/settings.gradle create mode 100644 example/android/settings.gradle.kts delete mode 100644 example/ios/Podfile.lock create mode 100644 example/ios/RunnerTests/RunnerTests.swift create mode 100644 example/lib/app.dart create mode 100644 example/lib/data/models/proxy_info.dart create mode 100644 example/lib/view/screens/proxy_screen.dart create mode 100644 example/lib/view/widgets/decorated_background.dart create mode 100644 example/lib/view/widgets/error_panel.dart create mode 100644 example/lib/view/widgets/footer_note.dart create mode 100644 example/lib/view/widgets/header_section.dart create mode 100644 example/lib/view/widgets/info_pill.dart create mode 100644 example/lib/view/widgets/status_card.dart create mode 100644 example/lib/view/widgets/status_dot.dart delete mode 100644 example/pubspec_overrides.yaml diff --git a/android/build.gradle.kts b/android/build.gradle.kts index f0c3e1b..6b002da 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,10 +1,8 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { - id("com.android.application") + id("com.android.library") id("kotlin-android") - // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. - id("dev.flutter.flutter-gradle-plugin") } allprojects { @@ -30,8 +28,7 @@ android { sourceSets["main"].java.srcDirs("src/main/kotlin") defaultConfig { - minSdk = flutter.minSdkVersion - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + minSdk = 23 } lint { diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index 82d65b0..b059a33 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -19,7 +19,7 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.13.2" apply false + id("com.android.library") version "8.13.2" apply false id("org.jetbrains.kotlin.android") version "2.3.0" apply false } diff --git a/example/.gitignore b/example/.gitignore index 0fa6b67..3820a95 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -5,9 +5,12 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ +migrate_working_dir/ # IntelliJ related *.iml @@ -24,15 +27,11 @@ **/doc/api/ **/ios/Flutter/.last_build_id .dart_tool/ -.flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ - -# Web related -lib/generated_plugin_registrant.dart +/coverage/ # Symbolication related app.*.symbols diff --git a/example/.metadata b/example/.metadata index 56bfc2c..a046c41 100644 --- a/example/.metadata +++ b/example/.metadata @@ -4,7 +4,30 @@ # This file should be version controlled and should not be manually edited. version: - revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 - channel: stable + revision: "f6ff1529fd6d8af5f706051d9251ac9231c83407" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + - platform: android + create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + - platform: ios + create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + + # 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/example/README.md b/example/README.md index a135626..154449a 100644 --- a/example/README.md +++ b/example/README.md @@ -1,6 +1,6 @@ # example -A new Flutter project. +native proxy example ## Getting Started @@ -8,9 +8,9 @@ This project is a starting point for a Flutter application. A few resources to get you started if this is your first Flutter project: -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, samples, guidance on mobile development, and a full API reference. diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index 0caccc8..f46ca3b 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -1 +1,8 @@ -include: ../analysis_options.yaml \ No newline at end of file +include: package:flutter_lints/flutter.yaml + +linter: + rules: + lines_longer_than_80_chars: false + prefer_const_constructors: true + prefer_const_declarations: true + prefer_const_literals_to_create_immutables: true diff --git a/example/android/.gitignore b/example/android/.gitignore index 0a741cb..be3943c 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -5,7 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # 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/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index 99076e7..0000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - id "dev.flutter.flutter-gradle-plugin" -} - -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' -} - -android { - compileSdkVersion 36 - - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - applicationId "com.veebee.proxy.example.example" - minSdkVersion flutter.minSdkVersion - targetSdkVersion 36 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KotlinVersion" -} \ No newline at end of file diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts new file mode 100644 index 0000000..ce91094 --- /dev/null +++ b/example/android/app/build.gradle.kts @@ -0,0 +1,43 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +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") +} + +android { + namespace = "com.example.example" + compileSdk = 36 + ndkVersion = "27.3.13750724" + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + applicationId = "com.example.example" + minSdk = flutter.minSdkVersion + targetSdk = 36 + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + signingConfig = signingConfigs.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } +} + +flutter { + source = "../.." +} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 207e1b6..399f698 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 7d207fc..74a78b9 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,11 +1,13 @@ - - + - - @@ -38,4 +31,15 @@ android:name="flutterEmbedding" android:value="2" /> + + + + + + + diff --git a/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 0000000..ac81bae --- /dev/null +++ b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/example/android/app/src/main/kotlin/com/veebee/proxy/example/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/veebee/proxy/example/example/MainActivity.kt deleted file mode 100644 index 61b2141..0000000 --- a/example/android/app/src/main/kotlin/com/veebee/proxy/example/example/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.veebee.proxy.example.example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml index 449a9f9..06952be 100644 --- a/example/android/app/src/main/res/values-night/styles.xml +++ b/example/android/app/src/main/res/values-night/styles.xml @@ -3,14 +3,14 @@