Token.fromJson constructor

Token.fromJson(
  1. Object? json
)

Implementation

factory Token.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return Token(
    bankAccount: map['bank_account'] == null
        ? null
        : BankAccount.fromJson(map['bank_account']),
    card: map['card'] == null ? null : Card.fromJson(map['card']),
    clientIp: map['client_ip'] == null ? null : (map['client_ip'] as String),
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    type: (map['type'] as String),
    used: (map['used'] as bool),
  );
}