fromJson static method

UuidDataType fromJson(
  1. Map<String, dynamic> data
)
override

Factory method: parse a JSON representation into a concrete DataType. Looks up the correct subclass in _dataTypes.

Implementation

static UuidDataType fromJson(Map<String, dynamic> data) {
  if (data['type'] != 'uuid') {
    throw Exception("Expected type 'uuid', got '${data['type']}'");
  }
  return UuidDataType(nullable: data["nullable"], metadata: data["metadata"]);
}