mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-11 17:40:15 +02:00
Fixed a Bug, Added Validation
This commit is contained in:
@@ -540,11 +540,27 @@ class AddAppPageState extends State<AddAppPage> {
|
|||||||
}),
|
}),
|
||||||
if (pickedSource != null)
|
if (pickedSource != null)
|
||||||
GeneratedForm(
|
GeneratedForm(
|
||||||
key: const Key('appId'),
|
key: Key(
|
||||||
|
'${pickedSource.runtimeType.toString()}-${pickedSource?.hostChanged.toString()}-${pickedSource?.hostIdenticalDespiteAnyChange.toString()}-appId'),
|
||||||
items: [
|
items: [
|
||||||
[
|
[
|
||||||
GeneratedFormTextField('appId',
|
GeneratedFormTextField('appId',
|
||||||
label: tr('appId'), required: false),
|
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) {
|
onValueChanges: (values, valid, isBuilding) {
|
||||||
|
Reference in New Issue
Block a user