ParseGuid static method

Uuid ParseGuid(
  1. String value
)
Parses a GUID string (new Guid(s)) into a Uuid in the "D" format (lower case, with hyphens), which is what Guid.ToString() produces.

Implementation

static Uuid ParseGuid(String value) {
  final match = _guidPattern.firstMatch(value.trim());
  if (match == null) {
    throw FormatException("'$value' is not a valid GUID");
  }
  return Uuid(
    [
      match.group(1),
      match.group(2),
      match.group(3),
      match.group(4),
      match.group(5),
    ].join("-").toLowerCase(),
  );
}