Fix "Bad State: No element" Error on Some Direct APK Links (#2128)

This commit is contained in:
Imran Remtulla
2025-02-21 10:22:49 -05:00
parent eb21ba3f6e
commit 430d1f2690

View File

@ -358,10 +358,12 @@ class HTML extends AppSource {
.toString();
return APKDetails(
version,
[rel]
.map((e) =>
MapEntry('${e.hashCode}-${Uri.parse(e).pathSegments.last}', e))
.toList(),
[rel].map((e) {
var uri = Uri.parse(e);
var fileName =
uri.pathSegments.isNotEmpty ? uri.pathSegments.last : uri.origin;
return MapEntry('${e.hashCode}-$fileName', e);
}).toList(),
AppNames(uri.host, tr('app')));
}
}