Merge pull request #1915 from InfiniteCoder06/main

Add Custom app ID
This commit is contained in:
Imran
2024-10-25 17:52:10 -04:00
committed by GitHub
2 changed files with 36 additions and 1 deletions

View File

@@ -538,6 +538,38 @@ class AddAppPageState extends State<AddAppPage> {
});
}
}),
if (pickedSource != null && pickedSource!.enforceTrackOnly)
GeneratedForm(
key: Key(
'${pickedSource.runtimeType.toString()}-${pickedSource?.hostChanged.toString()}-${pickedSource?.hostIdenticalDespiteAnyChange.toString()}-appId'),
items: [
[
GeneratedFormTextField('appId',
label: tr('appId'),
required: false,
additionalValidators: [
(value) {
if (value == null || value.isEmpty) {
return null;
}
final isValid = RegExp(
r'^([A-Za-z]{1}[A-Za-z\d_]*\.)+[A-Za-z][A-Za-z\d_]*$')
.hasMatch(value);
if (!isValid) {
return tr('invalidInput');
}
return null;
}
]),
]
],
onValueChanges: (values, valid, isBuilding) {
if (!isBuilding) {
setState(() {
additionalSettings['appId'] = values['appId'];
});
}
}),
],
);