validateServiceId static method

String? validateServiceId(
  1. String? value, {
  2. String? message,
})

Implementation

static String? validateServiceId(String? value, {String? message}) {
  if (value == null || value.isEmpty) {
    return message ?? 'ID de servicio requerido';
  }
  final RegExp serviceIdRegex = RegExp(r'^SER[0-9]+');
  if (!serviceIdRegex.hasMatch(value)) {
    return message ?? 'Formato de ID de servicio inválido';
  }
  return null;
}