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/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/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 d7e0853..270641a 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 @@ -12,11 +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: ^2.0.0 + in_app_update: ^4.0.1 + dio: ^5.2.1+1 + package_info_plus: ^4.0.2 dev_dependencies: flutter_test: