|
|
@ -314,13 +314,10 @@ class _SettingsState extends State<Settings> {
|
|
|
|
textFields: [
|
|
|
|
textFields: [
|
|
|
|
DialogTextField(
|
|
|
|
DialogTextField(
|
|
|
|
validator: (text) {
|
|
|
|
validator: (text) {
|
|
|
|
if (int.tryParse(text) == null || int.tryParse(text) < 0) {
|
|
|
|
if (text.isEmpty || (text.length == 4 && int.tryParse(text) >= 0)) {
|
|
|
|
return L10n.of(context).pleaseEnter4Digits;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (text.length != 4 && text.isNotEmpty) {
|
|
|
|
return L10n.of(context).pleaseEnter4Digits;
|
|
|
|
return L10n.of(context).pleaseEnter4Digits;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
obscureText: true,
|
|
|
|
obscureText: true,
|
|
|
|