Merge pull request #1975 from ImranR98/dev

Bugfixes for the "download release assets" button (#1968)
This commit is contained in:
Imran
2024-11-14 21:34:36 -05:00
committed by GitHub
4 changed files with 24 additions and 26 deletions

View File

@@ -1036,8 +1036,17 @@ class AppsProvider with ChangeNotifier {
if (apps[id]!.app.apkUrls.isNotEmpty || if (apps[id]!.app.apkUrls.isNotEmpty ||
apps[id]!.app.otherAssetUrls.isNotEmpty) { apps[id]!.app.otherAssetUrls.isNotEmpty) {
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
fileUrl = await confirmAppFileUrl(apps[id]!.app, context, true, MapEntry<String, String>? tempFileUrl = await confirmAppFileUrl(
apps[id]!.app, context, true,
evenIfSingleChoice: true); evenIfSingleChoice: true);
if (tempFileUrl != null) {
fileUrl = MapEntry(
tempFileUrl.key,
await (SourceProvider().getSource(apps[id]!.app.url,
overrideSource: apps[id]!.app.overrideSource))
.apkUrlPrefetchModifier(tempFileUrl.value, apps[id]!.app.url,
apps[id]!.app.additionalSettings));
}
} }
if (fileUrl != null) { if (fileUrl != null) {
filesToDownload.add(MapEntry(fileUrl, apps[id]!.app)); filesToDownload.add(MapEntry(fileUrl, apps[id]!.app));
@@ -1050,18 +1059,7 @@ class AppsProvider with ChangeNotifier {
Future<void> downloadFn(MapEntry<String, String> fileUrl, App app) async { Future<void> downloadFn(MapEntry<String, String> fileUrl, App app) async {
try { try {
var exportDir = await settingsProvider.getExportDir();
String downloadPath = '${await getStorageRootPath()}/Download'; String downloadPath = '${await getStorageRootPath()}/Download';
bool downloadsAccessible = false;
try {
Directory(downloadPath).listSync();
downloadsAccessible = true;
} catch (e) {
//
}
if (!downloadsAccessible && exportDir != null) {
downloadPath = exportDir.path;
}
await downloadFile(fileUrl.value, fileUrl.key, true, await downloadFile(fileUrl.value, fileUrl.key, true,
(double? progress) { (double? progress) {
notificationsProvider notificationsProvider

View File

@@ -303,10 +303,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: file_picker name: file_picker
sha256: aac85f20436608e01a6ffd1fdd4e746a7f33c93a2c83752e626bdfaea139b877 sha256: "16dc141db5a2ccc6520ebb6a2eb5945b1b09e95085c021d9f914f8ded7f1465c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "8.1.3" version: "8.1.4"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@@ -420,10 +420,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_local_notifications name: flutter_local_notifications
sha256: "725145682706fb0e5a30f93e5cb64f3df7ed7743de749bd555b22bf75ee718c0" sha256: ef41ae901e7529e52934feba19ed82827b11baa67336829564aeab3129460610
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "18.0.0" version: "18.0.1"
flutter_local_notifications_linux: flutter_local_notifications_linux:
dependency: transitive dependency: transitive
description: description:
@@ -1017,10 +1017,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: timezone name: timezone
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d" sha256: ffc9d5f4d1193534ef051f9254063fa53d588609418c84299956c3db9383587d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.9.4" version: "0.10.0"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@@ -1065,10 +1065,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_linux name: url_launcher_linux
sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.2.0" version: "3.2.1"
url_launcher_macos: url_launcher_macos:
dependency: transitive dependency: transitive
description: description:
@@ -1145,10 +1145,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: webview_flutter_android name: webview_flutter_android
sha256: dec83a8da0a2dcd8a25418534cc59348dbc2855fa1dd0cc929c62b6029fde392 sha256: "86c2d01c37c4578ee46560109cf2e18fb271f0d080a796f09188d0952352e057"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.0.1" version: "4.0.2"
webview_flutter_platform_interface: webview_flutter_platform_interface:
dependency: transitive dependency: transitive
description: description:
@@ -1161,10 +1161,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: webview_flutter_wkwebview name: webview_flutter_wkwebview
sha256: f14ee08021772fed913da8daebcfdeb46be457081e521e93e9918fe6cd1ce9e8 sha256: "3be297aa4ca78205abdd284cf55f168c35246c75b3079990ad8ba9d257681a30"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.16.1" version: "3.16.2"
win32: win32:
dependency: transitive dependency: transitive
description: description:

View File

@@ -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 # 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 # 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. # of the product and file versions while build-number is used as the build suffix.
version: 1.1.30+2287 version: 1.1.31+2288
environment: environment:
sdk: '>=3.0.0 <4.0.0' sdk: '>=3.0.0 <4.0.0'