uIntValidator static method
uIntValidator returns null if the given uInt
is valid.
Implementation
static String? uIntValidator(String? uInt) {
if (uInt == null || uInt.isEmpty) {
return ("Cannot be empty");
}
if (!RegExp(r'^[0-9]+$').hasMatch(uInt) && (uInt).isNotEmpty) {
return ("Only a positive integer number is allowed");
}
return (null);
}