validarNomeTributo static method
- String? tributo
Valida se um nome de tributo é válido
Implementation
static String? validarNomeTributo(String? tributo) {
if (tributo == null || tributo.isEmpty) {
return 'Nome do tributo é obrigatório';
}
if (tributo.length < 2) {
return 'Nome do tributo deve ter pelo menos 2 caracteres';
}
if (tributo.length > 100) {
return 'Nome do tributo deve ter no máximo 100 caracteres';
}
return null;
}