getDocument function

Document? getDocument(
  1. Map<String, dynamic>? json
)

Implementation

Document? getDocument(Map<String, dynamic>? json) {
  if (json != null) {
    switch (json['type']) {
      case "IdentityDocument":
        return IdentityDocument.fromJson(json);
      case "VehicleRegistrationDocument":
        return VehicleRegistrationDocument.fromJson(json);
      default:
        return null;
    }
  } else {
    return null;
  }
}