class SkillExpValidator {
  SkillExpValidator._();

  static String? validate(String value) {
    if (value.isEmpty) {
      return 'Experience is required';
    }
    var parsed = int.tryParse(value);
    if (value.isNotEmpty && parsed == null) {
      return 'Experience must be a number';
    }

    if (value.isNotEmpty && parsed! > 20 || parsed! < 1) {
      return 'Experience must be between 1 and 20';
    }

    return null;
  }
}
