UniqueId.fromJson constructor

UniqueId.fromJson(Map<String, dynamic> json)

Serializes a unique uid string from a Map object with the below structure to unique uid type

Example structure:

{ 'id': 'f9eb93fe-07d9-4b38-8117-f709aa438a18' }

Implementation

factory UniqueId.fromJson(Map<String, dynamic> json) {
  assert(json != null && json.isNotEmpty,
      'UniqueId.fromJson cannot be null or empty');
  return UniqueId._(Uuid(json['id']));
}