mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-22 18:33:45 +02:00
Dart fix + Flutter upgrade
This commit is contained in:
@@ -8,7 +8,7 @@ import 'package:obtainium/providers/source_provider.dart';
|
||||
|
||||
extension Unique<E, Id> on List<E> {
|
||||
List<E> unique([Id Function(E element)? id, bool inplace = true]) {
|
||||
final ids = Set();
|
||||
final ids = <dynamic>{};
|
||||
var list = inplace ? this : List<E>.from(this);
|
||||
list.retainWhere((x) => ids.add(id != null ? id(x) : x as Id));
|
||||
return list;
|
||||
@@ -76,7 +76,7 @@ class APKPure extends AppSource {
|
||||
return Uri.parse(standardUrl).pathSegments.last;
|
||||
}
|
||||
|
||||
getDetailsForVersion(
|
||||
Future<APKDetails> getDetailsForVersion(
|
||||
List<Map<String, dynamic>> versionVariants,
|
||||
List<String> supportedArchs,
|
||||
Map<String, dynamic> additionalSettings,
|
||||
|
@@ -16,7 +16,7 @@ class DirectAPKLink extends AppSource {
|
||||
.where((element) => element.key == 'requestHeader')
|
||||
.isNotEmpty,
|
||||
)
|
||||
.toList(),
|
||||
,
|
||||
[
|
||||
GeneratedFormDropdown(
|
||||
'defaultPseudoVersioningMethod',
|
||||
|
@@ -566,7 +566,7 @@ class GitHub extends AppSource {
|
||||
}
|
||||
}
|
||||
|
||||
getLatestAPKDetailsCommon2(
|
||||
Future<APKDetails> getLatestAPKDetailsCommon2(
|
||||
String standardUrl,
|
||||
Map<String, dynamic> additionalSettings,
|
||||
Future<String> Function(bool) reqUrlGenerator,
|
||||
@@ -667,7 +667,7 @@ class GitHub extends AppSource {
|
||||
);
|
||||
}
|
||||
|
||||
rateLimitErrorCheck(Response res) {
|
||||
void rateLimitErrorCheck(Response res) {
|
||||
if (res.headers['x-ratelimit-remaining'] == '0') {
|
||||
throw RateLimitError(
|
||||
(int.parse(res.headers['x-ratelimit-reset'] ?? '1800000000') / 60000000)
|
||||
|
@@ -24,10 +24,10 @@ class HuaweiAppGallery extends AppSource {
|
||||
return match.group(0)!;
|
||||
}
|
||||
|
||||
getDlUrl(String standardUrl) =>
|
||||
String getDlUrl(String standardUrl) =>
|
||||
'https://${hosts[0].replaceAll('appgallery.huawei', 'appgallery.cloud.huawei')}/appdl/${standardUrl.split('/').last}';
|
||||
|
||||
requestAppdlRedirect(
|
||||
Future<Response> requestAppdlRedirect(
|
||||
String dlUrl,
|
||||
Map<String, dynamic> additionalSettings,
|
||||
) async {
|
||||
@@ -45,7 +45,7 @@ class HuaweiAppGallery extends AppSource {
|
||||
}
|
||||
}
|
||||
|
||||
appIdFromRedirectDlUrl(String redirectDlUrl) {
|
||||
String appIdFromRedirectDlUrl(String redirectDlUrl) {
|
||||
var parts = redirectDlUrl
|
||||
.split('?')[0]
|
||||
.split('/')
|
||||
|
@@ -56,7 +56,7 @@ class NeutronCode extends AppSource {
|
||||
}
|
||||
}
|
||||
|
||||
customDateParse(String dateString) {
|
||||
String? customDateParse(String dateString) {
|
||||
List<String> parts = dateString.split(' ');
|
||||
if (parts.length != 3) {
|
||||
return null;
|
||||
|
@@ -3,7 +3,7 @@ import 'package:html/parser.dart';
|
||||
import 'package:obtainium/custom_errors.dart';
|
||||
import 'package:obtainium/providers/source_provider.dart';
|
||||
|
||||
parseDateTimeMMMddCommayyyy(String? dateString) {
|
||||
DateTime? parseDateTimeMMMddCommayyyy(String? dateString) {
|
||||
DateTime? releaseDate;
|
||||
try {
|
||||
releaseDate = dateString != null
|
||||
|
Reference in New Issue
Block a user