EntityId.fromJson constructor

EntityId.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory EntityId.fromJson(Map<String, dynamic> json) {
  if (json.containsKey('entityType') && json.containsKey('id')) {
    var entityType = entityTypeFromString(json['entityType']);
    String uuid = json['id'];
    return EntityId.fromTypeAndUuid(entityType, uuid);
  } else {
    throw FormatException('Missing entityType or id!');
  }
}