Broke GeneratedFormItem into sub-types

Prep for "chips" input type
This commit is contained in:
Imran Remtulla
2022-12-21 18:23:25 -05:00
parent 3cbaac2f5d
commit 9072862862
21 changed files with 238 additions and 188 deletions

View File

@@ -10,10 +10,7 @@ class SteamMobile extends AppSource {
host = 'store.steampowered.com';
name = tr('steam');
additionalSourceAppSpecificSettingFormItems = [
[
GeneratedFormItem('app',
label: tr('app'), required: true, opts: apks.entries.toList())
]
[GeneratedFormDropdown('app', apks.entries.toList(), label: tr('app'))]
];
}
@@ -30,11 +27,11 @@ class SteamMobile extends AppSource {
@override
Future<APKDetails> getLatestAPKDetails(
String standardUrl,
Map<String, String> additionalSettings,
Map<String, dynamic> additionalSettings,
) async {
Response res = await get(Uri.parse('https://$host/mobile'));
if (res.statusCode == 200) {
var apkNamePrefix = additionalSettings['app'];
var apkNamePrefix = additionalSettings['app'] as String?;
if (apkNamePrefix == null) {
throw NoReleasesError();
}