# ValidatorUtil class ValidatorUtil { static String? minLength(String? value, {int length = 1}) { if (value == null || value.isEmpty || value.trim().length < length) { if (length == 1) return t.validator.more_than_one_length; return t.validator.more_than_length(length: length); } return null; } static String? email(String? value) { final emailReg = RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$'); if (value == null || emailReg.hasMatch(value) == false) { return t.validator.email_format; } return null; } }