Guid.tryParseList constructor

Guid.tryParseList(
  1. List<int> guid
)

Initializes a new instance of the Guid structure by using the specified List of int.

Like parseList except that this function returns null where a similar call to parse would throw a FormatException.

Implementation

factory Guid.tryParseList(List<int> guid) {
  final Uint8List bytes = Uint8List.fromList(guid);

  if (guid.isNotEmpty && _Guid.isValidGUID(fromByteList: bytes)) {
    return Guid._(GuidValue(_Guid.unparse(bytes), bytes));
  }

  return Guid._();
}