From 328d1fb4f214da5e28c4edc6aefeec80fd004a53 Mon Sep 17 00:00:00 2001 From: Max Steffen Date: Thu, 12 May 2022 09:44:38 +0200 Subject: [PATCH 1/5] use unnamed constructor --- lib/new_version.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/new_version.dart b/lib/new_version.dart index c628de9..697eb50 100644 --- a/lib/new_version.dart +++ b/lib/new_version.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; import 'package:html/parser.dart' show parse; import 'package:http/http.dart' as http; import 'package:package_info_plus/package_info_plus.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; /// Information about the app's current version, and the most recent version /// available in the Apple App Store or Google Play Store. @@ -51,7 +51,7 @@ class VersionStatus { return false; } - VersionStatus._({ + VersionStatus({ required this.localVersion, required this.storeVersion, required this.appStoreLink, @@ -109,6 +109,7 @@ class NewVersion { } else { debugPrint( 'The target platform "${Platform.operatingSystem}" is not yet supported by this package.'); + return null; } } @@ -137,7 +138,7 @@ class NewVersion { debugPrint('Can\'t find an app in the App Store with the id: $id'); return null; } - return VersionStatus._( + return VersionStatus( localVersion: _getCleanVersion(packageInfo.version), storeVersion: _getCleanVersion(forceAppVersion ?? jsonObj['results'][0]['version']), @@ -174,7 +175,7 @@ class NewVersion { ?.querySelector('.DWPxHb') ?.text; - return VersionStatus._( + return VersionStatus( localVersion: _getCleanVersion(packageInfo.version), storeVersion: _getCleanVersion(forceAppVersion ?? storeVersion), appStoreLink: uri.toString(), @@ -265,8 +266,8 @@ class NewVersion { /// Launches the Apple App Store or Google Play Store page for the app. Future launchAppStore(String appStoreLink) async { debugPrint(appStoreLink); - if (await canLaunch(appStoreLink)) { - await launch(appStoreLink); + if (await canLaunchUrlString(appStoreLink)) { + await launchUrlString(appStoreLink); } else { throw 'Could not launch appStoreLink'; } From 1c28d104716059ec1eb2d56af8fd2ead21b6df0c Mon Sep 17 00:00:00 2001 From: Max Steffen Date: Thu, 12 May 2022 09:44:45 +0200 Subject: [PATCH 2/5] update packages --- pubspec.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index bbe79c9..fdc7ac2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: new_version description: Check if your user has the most recent version of your Flutter app. -version: 0.3.0 +version: 0.4.0 homepage: https://github.com/timtraversy/new_version environment: @@ -9,11 +9,11 @@ environment: dependencies: flutter: sdk: flutter - package_info_plus: ^1.0.0 - http: ^0.13.1 + package_info_plus: ^1.4.2 + http: ^0.13.4 html: ^0.15.0 - url_launcher: ^6.0.2 - collection: ^1.15.0 + url_launcher: ^6.1.0 + collection: ^1.16.0 dev_dependencies: flutter_test: From ebaa167e3a96a1023bb9960081d63a60b0043b7d Mon Sep 17 00:00:00 2001 From: Max Steffen Date: Thu, 12 May 2022 09:44:50 +0200 Subject: [PATCH 3/5] add changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12f98c9..ad4a105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.0 - 5/12/22 +* Add unnamed constructor to improve testing and mocking +* Fix lint warnings +* Bump packages to latest versions + ## 0.3.0 - 1/13/21 * #75: Add `forceAppVersion` field to make testing easier. * #77: Improve `canUpdate` logic so that greater local version won't prompt for an update. From c5ef0bb742f1751fc0f569396d310d84a77c4854 Mon Sep 17 00:00:00 2001 From: Max Steffen Date: Thu, 12 May 2022 09:45:09 +0200 Subject: [PATCH 4/5] update url_launcher package --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index fdc7ac2..1caac81 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: package_info_plus: ^1.4.2 http: ^0.13.4 html: ^0.15.0 - url_launcher: ^6.1.0 + url_launcher: ^6.1.2 collection: ^1.16.0 dev_dependencies: From bebe90e8da5d420a99f7fb37e4f6671bee6677f9 Mon Sep 17 00:00:00 2001 From: Max Steffen Date: Thu, 12 May 2022 09:54:56 +0200 Subject: [PATCH 5/5] bump compileSdkVersion to 31 bump kotlin_version to 1.6.10 --- example/android/app/build.gradle | 4 ++-- example/android/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 6ca2344..86d5ab4 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -36,7 +36,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.example" minSdkVersion 16 - targetSdkVersion 30 + targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/android/build.gradle b/example/android/build.gradle index c505a86..714549c 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.6.10' repositories { google() jcenter()