diff --git a/lib/pages/app.dart b/lib/pages/app.dart index bc0c6ec..efd6607 100644 --- a/lib/pages/app.dart +++ b/lib/pages/app.dart @@ -347,18 +347,6 @@ class _AppPageState extends State { } } - getResetInstallStatusButton() => TextButton( - onPressed: app?.app == null || updating - ? null - : () { - app!.app.installedVersion = null; - appsProvider.saveApps([app.app]); - }, - child: Text( - tr('resetInstallStatus'), - textAlign: TextAlign.center, - )); - getInstallOrUpdateButton() => TextButton( onPressed: !updating && (app?.app.installedVersion == null || @@ -403,16 +391,6 @@ class _AppPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - if (app?.app.installedVersion != null && - app?.app.installedVersion != app?.app.latestVersion && - !isVersionDetectionStandard && - !trackOnly) - IconButton( - onPressed: app?.downloadProgress != null || updating - ? null - : showMarkUpdatedDialog, - tooltip: tr('markUpdated'), - icon: const Icon(Icons.done)), if (source != null && source.combinedAppSpecificSettingFormItems.isNotEmpty) IconButton( @@ -458,14 +436,30 @@ class _AppPageState extends State { }, icon: const Icon(Icons.more_horiz), tooltip: tr('more')), + if (app?.app.installedVersion != null && + app?.app.installedVersion != app?.app.latestVersion && + !isVersionDetectionStandard && + !trackOnly) + IconButton( + onPressed: app?.downloadProgress != null || updating + ? null + : showMarkUpdatedDialog, + tooltip: tr('markUpdated'), + icon: const Icon(Icons.done)), + if ((!isVersionDetectionStandard || trackOnly) && + app?.app.installedVersion != null && + app?.app.installedVersion == app?.app.latestVersion) + IconButton( + onPressed: app?.app == null || updating + ? null + : () { + app!.app.installedVersion = null; + appsProvider.saveApps([app.app]); + }, + icon: const Icon(Icons.restore_rounded), + tooltip: tr('resetInstallStatus')), const SizedBox(width: 16.0), - Expanded( - child: (!isVersionDetectionStandard || trackOnly) && - app?.app.installedVersion != null && - app?.app.installedVersion == - app?.app.latestVersion - ? getResetInstallStatusButton() - : getInstallOrUpdateButton()), + Expanded(child: getInstallOrUpdateButton()), const SizedBox(width: 16.0), IconButton( onPressed: app?.downloadProgress != null || updating diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index c3fa50a..2f0c697 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -243,7 +243,9 @@ Future downloadFile( tempDownloadedFile.deleteSync(recursive: true); throw response.reasonPhrase ?? tr('unexpectedError'); } - tempDownloadedFile.renameSync(downloadedFile.path); + if (tempDownloadedFile.existsSync()) { + tempDownloadedFile.renameSync(downloadedFile.path); + } } else { client.close(); } diff --git a/pubspec.lock b/pubspec.lock index 91fe2cb..990d1bb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -482,10 +482,10 @@ packages: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" nested: dependency: transitive description: @@ -751,10 +751,10 @@ packages: dependency: "direct main" description: name: sqflite - sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a" + sha256: c2c32eb0c74021d987336522acc3b6bf0082fbd0c540c36a9cf4ddb8ba891ddc url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" sqflite_common: dependency: transitive description: @@ -927,10 +927,10 @@ packages: dependency: transitive description: name: webview_flutter_android - sha256: "161af93c2abaf94ef2192bffb53a3658b2d721a3bf99b69aa1e47814ee18cc96" + sha256: "4ea3c4e1b8ed590162b15b8a61b41b1ef3ff179a314627c16ce40c086d94b8af" url: "https://pub.dev" source: hosted - version: "3.13.2" + version: "3.14.0" webview_flutter_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 283024a..8f1d4f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.16.1+249 # When changing this, update the tag in main() accordingly +version: 1.0.0+250 # When changing this, update the tag in main() accordingly environment: sdk: '>=3.0.0 <4.0.0'