From a10c48e8b338bc15c706e479db3c57f71f008b68 Mon Sep 17 00:00:00 2001 From: Ben CHUKWUMA Date: Sun, 11 Jun 2023 19:16:03 +0100 Subject: [PATCH 1/4] Updated in app update plugin --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index d7e0853..ac08f67 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: # url_launcher will help us to trigger app store / play store url from our app. url_launcher: ^6.0.10 # Enables In App Updates on Android using the official Android APIs. - in_app_update: ^2.0.0 + in_app_update: ^4.0.1 dev_dependencies: flutter_test: From 2e508e393c4cf27fa094f7a6c4777061d79e4fd4 Mon Sep 17 00:00:00 2001 From: Ben CHUKWUMA Date: Tue, 13 Jun 2023 12:07:12 +0100 Subject: [PATCH 2/4] Resolved dio issues --- example/lib/dio.dart | 4 ++-- pubspec.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/example/lib/dio.dart b/example/lib/dio.dart index 3dbe947..fc80a53 100644 --- a/example/lib/dio.dart +++ b/example/lib/dio.dart @@ -62,8 +62,8 @@ class _HomeState extends State { try { Response response = await dio.get('/get'); - } on DioError catch (e) { - checkVersion(e.response.statusCode); + } on DioException catch (e) { + checkVersion(e.response!.statusCode!); } } } diff --git a/pubspec.yaml b/pubspec.yaml index ac08f67..d74e3d8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,6 +17,7 @@ dependencies: url_launcher: ^6.0.10 # Enables In App Updates on Android using the official Android APIs. in_app_update: ^4.0.1 + dio: ^5.2.1+1 dev_dependencies: flutter_test: From afda380febc2e9eb8a64d32bd9620aa1087dd801 Mon Sep 17 00:00:00 2001 From: Ben CHUKWUMA Date: Tue, 13 Jun 2023 12:08:55 +0100 Subject: [PATCH 3/4] Removed obsolete imports --- lib/src/update_cupertino_alert.dart | 2 -- pubspec.yaml | 1 - 2 files changed, 3 deletions(-) diff --git a/lib/src/update_cupertino_alert.dart b/lib/src/update_cupertino_alert.dart index 25f5b49..43ea4c8 100644 --- a/lib/src/update_cupertino_alert.dart +++ b/lib/src/update_cupertino_alert.dart @@ -1,7 +1,5 @@ import 'dart:io'; - import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; class UpdateCupertinoAlert extends StatelessWidget { diff --git a/pubspec.yaml b/pubspec.yaml index d74e3d8..07e97b0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,5 @@ name: native_updater description: Flutter package for prompting users to update with a native dialog whether using the app store version or any version at the user's discretion. -author: Ofload version: 0.1.1 homepage: https://github.com/ofload/native_updater From 4830b0115ab84319f524e88175617c2fa4f3bc8b Mon Sep 17 00:00:00 2001 From: Ben CHUKWUMA Date: Tue, 13 Jun 2023 12:14:52 +0100 Subject: [PATCH 4/4] Using package_info_plus package since the package_info one is discontinued --- lib/src/native_updater.dart | 4 +--- pubspec.yaml | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/src/native_updater.dart b/lib/src/native_updater.dart index b7be4bd..3c914fa 100644 --- a/lib/src/native_updater.dart +++ b/lib/src/native_updater.dart @@ -1,11 +1,9 @@ import 'dart:developer' as developer; import 'dart:io'; - +import 'package:package_info_plus/package_info_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:in_app_update/in_app_update.dart'; -import 'package:package_info/package_info.dart'; - import 'error_material_alert.dart'; import 'update_cupertino_alert.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 07e97b0..270641a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,12 +11,13 @@ dependencies: flutter: sdk: flutter # package_info will help us to find current installed version of application. - package_info: ^2.0.2 + # url_launcher will help us to trigger app store / play store url from our app. url_launcher: ^6.0.10 # Enables In App Updates on Android using the official Android APIs. in_app_update: ^4.0.1 dio: ^5.2.1+1 + package_info_plus: ^4.0.2 dev_dependencies: flutter_test: