fromJson static method

RawContact? fromJson(
  1. Map? json
)

Implementation

static RawContact? fromJson(Map? json) {
  if (json == null) return null;
  final accountJson = json['account'];
  final account = accountJson != null
      ? Account.fromJson(accountJson as Map)
      : null;
  final rawContactId = JsonHelpers.decode<String>(json['rawContactId']);
  final sourceId = JsonHelpers.decode<String>(json['sourceId']);
  if (rawContactId == null && sourceId == null && account == null) {
    return null;
  }
  return RawContact(
    rawContactId: rawContactId,
    sourceId: sourceId,
    account: account,
  );
}