isUUID function

bool isUUID(
  1. String? str, [
  2. dynamic version
])

check if the string is a UUID (version 3, 4 or 5).

Implementation

bool isUUID(String? str, [version]) {
  if (version == null) {
    version = 'all';
  } else {
    version = version.toString();
  }

  RegExp? pat = _uuid[version];
  return (pat != null && pat.hasMatch(str!.toUpperCase()));
}