F-Droid repo search bugfix (#1681)

This commit is contained in:
Imran Remtulla
2024-06-28 21:28:02 -04:00
parent 2938cea419
commit 105e70a814
3 changed files with 26 additions and 0 deletions

View File

@ -86,6 +86,27 @@ class FDroidRepo extends AppSource {
}
}
@override
void runOnAddAppInputChange(String userInput) {
this.additionalSourceAppSpecificSettingFormItems =
this.additionalSourceAppSpecificSettingFormItems.map((row) {
row = row.map((item) {
if (item.key == 'appIdOrName') {
try {
var appId = Uri.parse(userInput).queryParameters['appId'];
if (appId != null && item is GeneratedFormTextField) {
item.required = false;
}
} catch (e) {
//
}
}
return item;
}).toList();
return row;
}).toList();
}
@override
App endOfGetAppChanges(App app) {
var uri = Uri.parse(app.url);

View File

@ -71,6 +71,7 @@ class AddAppPageState extends State<AddAppPage> {
if (pickedSource.runtimeType != source.runtimeType ||
(prevHost != null && prevHost != source?.hosts[0])) {
pickedSource = source;
pickedSource?.runOnAddAppInputChange(userInput);
additionalSettings = source != null
? getDefaultValuesFromFormItems(
source.combinedAppSpecificSettingFormItems)

View File

@ -463,6 +463,10 @@ abstract class AppSource {
}
}
void runOnAddAppInputChange(String inputUrl) {
//
}
String sourceSpecificStandardizeURL(String url) {
throw NotImplementedError();
}