Snapshot.fromJson constructor

Snapshot.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory Snapshot.fromJson(Map<String, Object?> json) => Snapshot(
      id: json["id"] as String,
      bankAccount: json["bank_account"] == null
          ? null
          : SnapshotBankAccount.fromJson(
              (json["bank_account"] as Map).cast<String, Object?>(),
            ),
      card: json["card"] == null
          ? null
          : Card.fromJson(
              (json["card"] as Map).cast<String, Object?>(),
            ),
      createdAt: decodeDateTime(json["created_at"]),
      customerId: json["customer_id"] as String,
      mobileMoney: json["mobile_money"] == null
          ? null
          : SnapshotMobileMoney.fromJson(
              (json["mobile_money"] as Map).cast<String, Object?>(),
            ),
      owner: json["owner"] == null
          ? null
          : SnapshotOwner.fromJson(
              (json["owner"] as Map).cast<String, Object?>(),
            ),
      type: Type.fromJson(json["type"]),
      verified: json["verified"] as bool,
      verifiedAt: json["verified_at"] == null
          ? null
          : decodeDateTime(json["verified_at"]),
    );