added validator for whole numbers

This commit is contained in:
2026-07-16 16:10:33 +02:00
parent 4af3683b73
commit e1eafdca59
+9
View File
@@ -7,6 +7,15 @@ String? timeValidator(String? value) {
return 'Not a valid time format';
}
String? wholeNumberValidator(String? value) {
if (value == null || value.isEmpty) return null;
if (RegExp(r'^[0-9]*$').hasMatch(value)) {
return null;
}
return 'Not a valid number';
}
String? dateTimeValidator(String? value) {
if (value == null || value.isEmpty) return null;