Skip to content
Merged
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [0.1.5] - 02/03/2026

- Replicate upstream dependency/example updates from `ofload/native_updater` PR #40.
- Add `dio: ^5.2.1+1` to **example** dependencies.
- Update Dio example to use `DioException` handling compatible with Dio 5.
- Credit: original PR authored by [@benthemobileguy](https://github.com/benthemobileguy) (Ben CHUKWUMA).

## [0.1.4] - 02/03/2026

- Replicate upstream Dart SDK constraint bump from `ofload/native_updater` PR #35.
Expand Down
9 changes: 3 additions & 6 deletions example/lib/dio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ class _HomeState extends State<Home> {
));

try {
await dio.get('/get');
} on DioError catch (e) {
final statusCode = e.response?.statusCode;
if (statusCode != null) {
checkVersion(statusCode);
}
Response response = await dio.get('/get');
} on DioException catch (e) {
checkVersion(e.response!.statusCode!);
}
}
}
30 changes: 27 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@ packages:
dependency: "direct main"
description:
name: dio
sha256: bf173c8bc66b776e3c2892b6ac56ac1a5ad73d21dd06d337f9fe656f63612947
sha256: aff32c08f92787a557dd5c0145ac91536481831a01b4648136373cddb0e64f8c
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.9.2"
dio_web_adapter:
dependency: transitive
description:
name: dio_web_adapter
sha256: "2f9e64323a7c3c7ef69567d5c800424a11f8337b8b228bad02524c9fb3c1f340"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -168,13 +176,21 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.17.0"
mime:
dependency: transitive
description:
name: mime
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
native_updater:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.1.4"
version: "0.1.5"
package_info_plus:
dependency: transitive
description:
Expand Down Expand Up @@ -348,6 +364,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "15.0.2"
web:
dependency: transitive
description:
name: web
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
win32:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.3
dio: ^4.0.0
dio: ^5.2.1+1
native_updater:
path: ../

Expand Down
14 changes: 10 additions & 4 deletions lib/src/native_updater.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,17 @@ class NativeUpdater {

if (_updateInfo.updateAvailability == UpdateAvailability.updateAvailable) {
if (_forceUpdate == true) {
InAppUpdate.performImmediateUpdate()
.catchError((e) => developer.log(e.toString()));
try {
await InAppUpdate.performImmediateUpdate();
} catch (e) {
developer.log(e.toString());
}
} else if (_forceUpdate == false) {
InAppUpdate.startFlexibleUpdate()
.catchError((e) => developer.log(e.toString()));
try {
await InAppUpdate.startFlexibleUpdate();
} catch (e) {
developer.log(e.toString());
}
}
}
} on PlatformException catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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.

version: 0.1.4
version: 0.1.5
homepage: https://github.com/milhomem/native_updater

environment:
Expand Down