isNotNull function
return an error message if value does not pass the validation validation requires val: not equal null
Implementation
String? isNotNull(String? val) {
if (val == null) {
return "can't be left empty ";
}
return val.toString().isNotEmpty ? null : "can't be left empty ";
}