validateName static method

String? validateName(
  1. String? value
)

Implementation

static String? validateName(String? value) {
  if (value == null || value.isEmpty) {
    return 'Name is required';
  } else if (value.length < 3) {
    return 'Name must be at least 3 characters';
  }
  return null;
}