mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-21 05:29:29 +02:00
Dart fix + Flutter upgrade
This commit is contained in:
@@ -112,7 +112,7 @@ Set<String> findStandardFormatsForVersion(String version, bool strict) {
|
||||
return results;
|
||||
}
|
||||
|
||||
moveStrToEnd(List<String> arr, String str, {String? strB}) {
|
||||
List<String> moveStrToEnd(List<String> arr, String str, {String? strB}) {
|
||||
String? temp;
|
||||
arr.removeWhere((element) {
|
||||
bool res = element == str || element == strB;
|
||||
@@ -269,7 +269,7 @@ Future<String?> checkETagHeader(
|
||||
.toString();
|
||||
}
|
||||
|
||||
deleteFile(File file) {
|
||||
void deleteFile(File file) {
|
||||
try {
|
||||
file.deleteSync(recursive: true);
|
||||
} on PathAccessException catch (e) {
|
||||
@@ -1826,7 +1826,7 @@ class AppsProvider with ChangeNotifier {
|
||||
await intent.launch();
|
||||
}
|
||||
|
||||
addMissingCategories(SettingsProvider settingsProvider) {
|
||||
void addMissingCategories(SettingsProvider settingsProvider) {
|
||||
var cats = settingsProvider.categories;
|
||||
apps.forEach((key, value) {
|
||||
for (var c in value.app.categories) {
|
||||
|
@@ -218,7 +218,7 @@ class NotificationsProvider {
|
||||
false;
|
||||
}
|
||||
|
||||
checkLaunchByNotif() async {
|
||||
Future<void> checkLaunchByNotif() async {
|
||||
final NotificationAppLaunchDetails? launchDetails = await notifications
|
||||
.getNotificationAppLaunchDetails();
|
||||
if (launchDetails?.didNotificationLaunchApp ?? false) {
|
||||
@@ -229,7 +229,7 @@ class NotificationsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
_showNotificationPayload(String? payload, {bool doublePop = false}) {
|
||||
void _showNotificationPayload(String? payload, {bool doublePop = false}) {
|
||||
if (payload?.isNotEmpty == true) {
|
||||
var title = (payload ?? '\n\n').split('\n').first;
|
||||
var content = (payload ?? '\n\n').split('\n').sublist(1).join('\n');
|
||||
|
@@ -63,15 +63,15 @@ class APKDetails {
|
||||
});
|
||||
}
|
||||
|
||||
stringMapListTo2DList(List<MapEntry<String, String>> mapList) =>
|
||||
List<List<String>> stringMapListTo2DList(List<MapEntry<String, String>> mapList) =>
|
||||
mapList.map((e) => [e.key, e.value]).toList();
|
||||
|
||||
assumed2DlistToStringMapList(List<dynamic> arr) =>
|
||||
List<MapEntry<String, String>> assumed2DlistToStringMapList(List<dynamic> arr) =>
|
||||
arr.map((e) => MapEntry(e[0] as String, e[1] as String)).toList();
|
||||
|
||||
// App JSON schema has changed multiple times over the many versions of Obtainium
|
||||
// This function takes an App JSON and modifies it if needed to conform to the latest (current) version
|
||||
appJSONCompatibilityModifiers(Map<String, dynamic> json) {
|
||||
Map<String, dynamic> appJSONCompatibilityModifiers(Map<String, dynamic> json) {
|
||||
var source = SourceProvider().getSource(
|
||||
json['url'],
|
||||
overrideSource: json['overrideSource'],
|
||||
@@ -454,7 +454,7 @@ class App {
|
||||
}
|
||||
|
||||
// Ensure the input is starts with HTTPS and has no WWW
|
||||
preStandardizeUrl(String url) {
|
||||
String preStandardizeUrl(String url) {
|
||||
var firstDotIndex = url.indexOf('.');
|
||||
if (!(firstDotIndex >= 0 && firstDotIndex != url.length - 1)) {
|
||||
throw UnsupportedURLError();
|
||||
@@ -529,7 +529,7 @@ Future<List<MapEntry<String, String>>> filterApksByArch(
|
||||
return apkUrls;
|
||||
}
|
||||
|
||||
getSourceRegex(List<String> hosts) {
|
||||
String getSourceRegex(List<String> hosts) {
|
||||
return '(${hosts.join('|').replaceAll('.', '\\.')})';
|
||||
}
|
||||
|
||||
@@ -637,7 +637,7 @@ abstract class AppSource {
|
||||
name = runtimeType.toString();
|
||||
}
|
||||
|
||||
overrideAdditionalAppSpecificSourceAgnosticSettingSwitch(
|
||||
void overrideAdditionalAppSpecificSourceAgnosticSettingSwitch(
|
||||
String key, {
|
||||
bool disabled = true,
|
||||
bool defaultValue = true,
|
||||
@@ -949,7 +949,7 @@ abstract class MassAppUrlSource {
|
||||
Future<Map<String, List<String>>> getUrlsWithDescriptions(List<String> args);
|
||||
}
|
||||
|
||||
regExValidator(String? value) {
|
||||
String? regExValidator(String? value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
@@ -961,7 +961,7 @@ regExValidator(String? value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
intValidator(String? value, {bool positive = false}) {
|
||||
String? intValidator(String? value, {bool positive = false}) {
|
||||
if (value == null) {
|
||||
return tr('invalidInput');
|
||||
}
|
||||
@@ -980,7 +980,7 @@ bool isTempId(App app) {
|
||||
return RegExp('^[0-9]+\$').hasMatch(app.id);
|
||||
}
|
||||
|
||||
replaceMatchGroupsInString(RegExpMatch match, String matchGroupString) {
|
||||
String? replaceMatchGroupsInString(RegExpMatch match, String matchGroupString) {
|
||||
if (RegExp('^\\d+\$').hasMatch(matchGroupString)) {
|
||||
matchGroupString = '\$$matchGroupString';
|
||||
}
|
||||
@@ -1049,7 +1049,7 @@ List<MapEntry<String, String>> filterApks(
|
||||
return apkUrls;
|
||||
}
|
||||
|
||||
isVersionPseudo(App app) =>
|
||||
bool isVersionPseudo(App app) =>
|
||||
app.additionalSettings['trackOnly'] == true ||
|
||||
(app.installedVersion != null &&
|
||||
app.additionalSettings['versionDetection'] != true);
|
||||
|
Reference in New Issue
Block a user