isPassword function
return an error message if value does not pass the validation validation requires val: not equal null and length must be more than 7 characters
Implementation
String? isPassword(String? val) {
return (val.toString().isNotEmpty && val.toString().length > 7)
? null
: "Password must be up to 8 characters";
}