isUUID method

ContractValidations isUUID(
  1. String value,
  2. String property,
  3. String message
)

Implementation

ContractValidations isUUID(String value, String property, String message) {
  if (!RegExp(
          r'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')
      .hasMatch(value)) {
    addNotifications(
        ValidationNotification(property: property, message: message));
  }
  return this;
}