diff --git a/lib/src/native_updater.dart b/lib/src/native_updater.dart index b7be4bd..e3db7e5 100644 --- a/lib/src/native_updater.dart +++ b/lib/src/native_updater.dart @@ -12,6 +12,7 @@ import 'update_cupertino_alert.dart'; class NativeUpdater { late BuildContext _context; late bool _forceUpdate; + late bool _showErrorDialog; late String _appName; String? _appStoreUrl; String? _iOSDescription; @@ -34,6 +35,7 @@ class NativeUpdater { static displayUpdateAlert( BuildContext context, { required bool forceUpdate, + bool? showErrorDialog, String? appStoreUrl, String? iOSDescription, String? iOSUpdateButtonLabel, @@ -52,6 +54,7 @@ class NativeUpdater { /// Set singleton properties _nativeUpdaterInstance._context = context; _nativeUpdaterInstance._forceUpdate = forceUpdate; + _nativeUpdaterInstance._showErrorDialog = showErrorDialog; _nativeUpdaterInstance._appName = info.appName; _nativeUpdaterInstance._appStoreUrl = appStoreUrl; _nativeUpdaterInstance._iOSDescription = iOSDescription; @@ -119,6 +122,10 @@ class NativeUpdater { } } } on PlatformException catch (e) { + if (_showErrorDialog == true) { + return; + } + developer.log(e.code.toString()); showDialog(