Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated in app update plugin #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/lib/dio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class _HomeState extends State<Home> {

try {
Response response = await dio.get('/get');
} on DioError catch (e) {
checkVersion(e.response.statusCode);
} on DioException catch (e) {
checkVersion(e.response!.statusCode!);
}
}
}
4 changes: 1 addition & 3 deletions lib/src/native_updater.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 0 additions & 2 deletions lib/src/update_cupertino_alert.dart
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>

version: 0.1.1
homepage: https://github.com/ofload/native_updater
Expand All @@ -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:
Expand Down