diff --git a/.github/workflows/location-prepare.yaml b/.github/workflows/location-prepare.yaml index 0a390ccb..e558c2c9 100644 --- a/.github/workflows/location-prepare.yaml +++ b/.github/workflows/location-prepare.yaml @@ -12,15 +12,16 @@ jobs: strategy: fail-fast: false matrix: - flutter-version: ['3.3.x', '3.7.x', '3.10.x'] + flutter-version: ["3.16.x", "3.19.x"] steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Flutter uses: subosito/flutter-action@v2 with: + channel: stable flutter-version: ${{ matrix.flutter-version }} - name: Set up Melos @@ -47,15 +48,15 @@ jobs: steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version: 3.10.x + flutter-version: 3.16.x - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 @@ -74,12 +75,12 @@ jobs: steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version: 3.10.x + flutter-version: 3.16.x - name: Install tools run: brew install clang-format diff --git a/.github/workflows/location-publish.yaml b/.github/workflows/location-publish.yaml index c480857a..4b207f36 100644 --- a/.github/workflows/location-publish.yaml +++ b/.github/workflows/location-publish.yaml @@ -2,7 +2,7 @@ name: location publish on: push: - tags: ['location-v*'] + tags: ["location-v*"] jobs: publish: @@ -15,7 +15,7 @@ jobs: steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # This step adds the auth token for pub.dev - name: Set up Dart diff --git a/.github/workflows/location_platform_interface-publish.yaml b/.github/workflows/location_platform_interface-publish.yaml index 5112ce18..49637fcb 100644 --- a/.github/workflows/location_platform_interface-publish.yaml +++ b/.github/workflows/location_platform_interface-publish.yaml @@ -2,7 +2,7 @@ name: location_platform_interface publish on: push: - tags: ['location_platform_interface-v*'] + tags: ["location_platform_interface-v*"] jobs: publish: @@ -15,7 +15,7 @@ jobs: steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # This step adds the auth token for pub.dev - name: Set up Dart diff --git a/.github/workflows/location_web-publish.yaml b/.github/workflows/location_web-publish.yaml index 6f787ff9..baca260f 100644 --- a/.github/workflows/location_web-publish.yaml +++ b/.github/workflows/location_web-publish.yaml @@ -2,7 +2,7 @@ name: location_web publish on: push: - tags: ['location_web-v*'] + tags: ["location_web-v*"] jobs: publish: @@ -15,7 +15,7 @@ jobs: steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # This step adds the auth token for pub.dev - name: Set up Dart diff --git a/packages/location/android/build.gradle b/packages/location/android/build.gradle index 5327ac0d..a67a2d65 100644 --- a/packages/location/android/build.gradle +++ b/packages/location/android/build.gradle @@ -1,8 +1,7 @@ -group "com.lyokone.location" -version "1.0-SNAPSHOT" +group = "com.lyokone.location" +version = "1.0-SNAPSHOT" buildscript { - ext.kotlin_version = "1.9.0" repositories { google() mavenCentral() @@ -10,9 +9,9 @@ buildscript { } dependencies { - classpath "com.android.tools.build:gradle:7.4.2" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.0") + classpath "com.android.tools.build:gradle:8.3.1" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23" + classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0" } } @@ -26,16 +25,16 @@ apply plugin: "kotlin-android" apply plugin: "org.jlleitschuh.gradle.ktlint" android { - namespace "com.lyokone.location" - compileSdk 33 + namespace = "com.lyokone.location" + compileSdk = 34 defaultConfig { - minSdk 16 + minSdk = 21 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { @@ -47,7 +46,6 @@ android { dependencies { compileOnly "androidx.annotation:annotation:1.6.0" - api "com.google.android.gms:play-services-location:21.0.1" + api "com.google.android.gms:play-services-location:21.2.0" implementation "androidx.core:core-ktx:1.10.1" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" } diff --git a/packages/location/android/settings.gradle b/packages/location/android/settings.gradle index 82139d04..35c5bd99 100644 --- a/packages/location/android/settings.gradle +++ b/packages/location/android/settings.gradle @@ -1 +1 @@ -rootProject.name = 'location' +rootProject.name = "location" diff --git a/packages/location/example/android/app/build.gradle b/packages/location/example/android/app/build.gradle index e0e74c79..d8987eff 100644 --- a/packages/location/example/android/app/build.gradle +++ b/packages/location/example/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "dev.flutter.flutter-gradle-plugin" + id "org.jetbrains.kotlin.android" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file("local.properties") if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -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" @@ -21,35 +22,32 @@ if (flutterVersionName == null) { flutterVersionName = "1.0" } -apply plugin: "com.android.application" -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdk 33 - namespace "com.lyokone.location.example" + compileSdk = 34 + namespace = "com.lyokone.location.example" defaultConfig { - applicationId "com.lyokone.location.example" - minSdk 16 - targetSdk 33 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + applicationId = "com.lyokone.location.example" + minSdk = 21 + targetSdk = 34 + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } 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 "../.." + source = "../.." } diff --git a/packages/location/example/android/build.gradle b/packages/location/example/android/build.gradle index 730672b7..ebc70451 100644 --- a/packages/location/example/android/build.gradle +++ b/packages/location/example/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = "1.9.0" - repositories { - google() - mavenCentral() - } - - dependencies { - classpath "com.android.tools.build:gradle:7.4.2" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() diff --git a/packages/location/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/location/example/android/gradle/wrapper/gradle-wrapper.properties index cb046be6..7aeeb11c 100644 --- a/packages/location/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/location/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/packages/location/example/android/settings.gradle b/packages/location/example/android/settings.gradle index e791cf5c..82f7f6e9 100644 --- a/packages/location/example/android/settings.gradle +++ b/packages/location/example/android/settings.gradle @@ -1,11 +1,25 @@ -include ":app" +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +plugins { + id "dev.flutter.flutter-plugin-loader" + id "com.android.application" version "8.3.1" apply false + id "org.jetbrains.kotlin.android" version "1.9.23" apply false +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +include ":app" diff --git a/packages/location/example/android/settings_aar.gradle b/packages/location/example/android/settings_aar.gradle deleted file mode 100644 index e7b4def4..00000000 --- a/packages/location/example/android/settings_aar.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/packages/location/example/lib/enable_in_background.dart b/packages/location/example/lib/enable_in_background.dart index 7affc833..629346dd 100644 --- a/packages/location/example/lib/enable_in_background.dart +++ b/packages/location/example/lib/enable_in_background.dart @@ -74,9 +74,9 @@ class _EnableInBackgroundState extends State { ElevatedButton( onPressed: _enabled == null ? null : _toggleBackgroundMode, child: Text(_enabled ?? false ? 'Disable' : 'Enable'), - ) + ), ], - ) + ), ], ); } diff --git a/packages/location/example/lib/get_location.dart b/packages/location/example/lib/get_location.dart index b54e0223..e90b20a0 100644 --- a/packages/location/example/lib/get_location.dart +++ b/packages/location/example/lib/get_location.dart @@ -54,7 +54,7 @@ class _GetLocationState extends State { color: Colors.white, ) : const Text('Get'), - ) + ), ], ), ], diff --git a/packages/location/example/lib/listen_location.dart b/packages/location/example/lib/listen_location.dart index 88231c1b..9d5a5952 100644 --- a/packages/location/example/lib/listen_location.dart +++ b/packages/location/example/lib/listen_location.dart @@ -78,7 +78,7 @@ class _ListenLocationState extends State { ElevatedButton( onPressed: _locationSubscription != null ? _stopListen : null, child: const Text('Stop'), - ) + ), ], ), ], diff --git a/packages/location/example/lib/main.dart b/packages/location/example/lib/main.dart index 284e61ee..1f5abd86 100644 --- a/packages/location/example/lib/main.dart +++ b/packages/location/example/lib/main.dart @@ -84,7 +84,7 @@ class _MyHomePageState extends State { IconButton( icon: const Icon(Icons.info_outline), onPressed: _showInfoDialog, - ) + ), ], ), body: SingleChildScrollView( @@ -108,7 +108,7 @@ class _MyHomePageState extends State { const Divider(height: 32), const EnableInBackgroundWidget(), const Divider(height: 32), - const ChangeNotificationWidget() + const ChangeNotificationWidget(), ], ), ), diff --git a/packages/location/example/lib/permission_status.dart b/packages/location/example/lib/permission_status.dart index 2e7ece43..4bff8d49 100644 --- a/packages/location/example/lib/permission_status.dart +++ b/packages/location/example/lib/permission_status.dart @@ -52,9 +52,9 @@ class _PermissionStatusState extends State { ? null : _requestPermission, child: const Text('Request'), - ) + ), ], - ) + ), ], ); } diff --git a/packages/location/example/lib/service_enabled.dart b/packages/location/example/lib/service_enabled.dart index 76db15ab..665dc439 100644 --- a/packages/location/example/lib/service_enabled.dart +++ b/packages/location/example/lib/service_enabled.dart @@ -52,9 +52,9 @@ class _ServiceEnabledState extends State { ElevatedButton( onPressed: (_serviceEnabled ?? false) ? null : _requestService, child: const Text('Request'), - ) + ), ], - ) + ), ], ); } diff --git a/packages/location/example/pubspec.yaml b/packages/location/example/pubspec.yaml index ca98092d..764f607b 100644 --- a/packages/location/example/pubspec.yaml +++ b/packages/location/example/pubspec.yaml @@ -4,15 +4,15 @@ publish_to: none version: 1.0.0+1 environment: - sdk: '>=2.18.0 <4.0.0' - flutter: '>=3.3.0' + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.16.0" dependencies: flutter: sdk: flutter location: path: ../ - url_launcher: ^6.0.2 + url_launcher: ^6.2.5 dev_dependencies: leancode_lint: ^3.0.0 diff --git a/packages/location/pubspec.yaml b/packages/location/pubspec.yaml index 0ff0f300..a8f6df19 100644 --- a/packages/location/pubspec.yaml +++ b/packages/location/pubspec.yaml @@ -6,8 +6,8 @@ repository: https://github.com/Lyokone/flutterlocation issue_tracker: https://github.com/Lyokone/flutterlocation/issues environment: - sdk: '>=2.18.0 <4.0.0' - flutter: '>=3.3.0' + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.16.0" flutter: plugin: @@ -25,12 +25,12 @@ flutter: dependencies: flutter: sdk: flutter - location_platform_interface: ^3.1.1 - location_web: ^4.1.1 + location_platform_interface: ^3.1.2 + location_web: ^4.2.0 dev_dependencies: - async: ^2.5.0 - build_runner: ^2.3.3 + async: ^2.11.0 + build_runner: ^2.4.9 flutter_test: sdk: flutter leancode_lint: ^3.0.0 - mockito: ^5.0.0 + mockito: ^5.4.4 diff --git a/packages/location_platform_interface/lib/src/method_channel_location.dart b/packages/location_platform_interface/lib/src/method_channel_location.dart index 0aea662b..bb1ee650 100644 --- a/packages/location_platform_interface/lib/src/method_channel_location.dart +++ b/packages/location_platform_interface/lib/src/method_channel_location.dart @@ -47,7 +47,7 @@ class MethodChannelLocation extends LocationPlatform { { 'accuracy': accuracy!.index, 'interval': interval, - 'distanceFilter': distanceFilter + 'distanceFilter': distanceFilter, }, ); diff --git a/packages/location_platform_interface/pubspec.yaml b/packages/location_platform_interface/pubspec.yaml index b08b4f73..3a81c344 100644 --- a/packages/location_platform_interface/pubspec.yaml +++ b/packages/location_platform_interface/pubspec.yaml @@ -4,18 +4,18 @@ version: 3.1.2 homepage: https://github.com/Lyokone/flutterlocation environment: - sdk: '>=2.18.0 <4.0.0' - flutter: '>=3.3.0' + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.16.0" dependencies: flutter: sdk: flutter - plugin_platform_interface: ^2.1.5 + plugin_platform_interface: ^2.1.8 dev_dependencies: - async: ^2.5.0 - build_runner: ^2.3.3 + async: ^2.11.0 + build_runner: ^2.4.9 flutter_test: sdk: flutter leancode_lint: ^3.0.0 - mockito: ^5.0.0 + mockito: ^5.4.4 diff --git a/packages/location_platform_interface/test/method_channel_location_test.dart b/packages/location_platform_interface/test/method_channel_location_test.dart index aa4797cc..11dbd32c 100644 --- a/packages/location_platform_interface/test/method_channel_location_test.dart +++ b/packages/location_platform_interface/test/method_channel_location_test.dart @@ -65,7 +65,7 @@ void main() { arguments: { 'accuracy': LocationAccuracy.high.index, 'interval': 1000, - 'distanceFilter': 0 + 'distanceFilter': 0, }, ), ]); diff --git a/packages/location_platform_interface/test/types_test.dart b/packages/location_platform_interface/test/types_test.dart index 30019911..2c2605bf 100644 --- a/packages/location_platform_interface/test/types_test.dart +++ b/packages/location_platform_interface/test/types_test.dart @@ -23,7 +23,7 @@ void main() { 'speed': 2.0, 'speed_accuracy': 2.0, 'heading': 2.0, - 'time': 2.0 + 'time': 2.0, }); final otherLocationData = LocationData.fromMap({ 'latitude': 42.0, @@ -33,7 +33,7 @@ void main() { 'speed': 2.0, 'speed_accuracy': 2.0, 'heading': 2.0, - 'time': 2.0 + 'time': 2.0, }); expect(otherLocationData == locationData, true); @@ -49,7 +49,7 @@ void main() { 'speed': 2.0, 'speed_accuracy': 2.0, 'heading': 2.0, - 'time': 2.0 + 'time': 2.0, }); final otherLocationData = LocationData.fromMap({ 'latitude': 42.0, @@ -59,7 +59,7 @@ void main() { 'speed': 2.0, 'speed_accuracy': 2.0, 'heading': 2.0, - 'time': 2.0 + 'time': 2.0, }); expect(otherLocationData == locationData, false); diff --git a/packages/location_web/pubspec.yaml b/packages/location_web/pubspec.yaml index cce5e25a..731d7e6e 100644 --- a/packages/location_web/pubspec.yaml +++ b/packages/location_web/pubspec.yaml @@ -6,22 +6,22 @@ repository: https://github.com/Lyokone/flutterlocation issue_tracker: https://github.com/Lyokone/flutterlocation/issues environment: - sdk: '>=2.18.0 <4.0.0' - flutter: '>=3.3.0' + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.16.0" dependencies: flutter: sdk: flutter flutter_web_plugins: sdk: flutter - http_parser: ^4.0.0 - js: ^0.6.3 - location_platform_interface: ^3.1.1 + http_parser: ^4.0.2 + js: ^0.6.7 + location_platform_interface: ^3.1.2 dev_dependencies: flutter_test: sdk: flutter - mockito: ^5.0.0 + mockito: ^5.4.4 flutter: plugin: