fromJson static method
Implementation
static CollectibleItemInfo? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return CollectibleItemInfo(
purchaseDate: (json['purchase_date'] as int?) ?? 0,
currency: (json['currency'] as String?) ?? '',
amount: (json['amount'] as int?) ?? 0,
cryptocurrency: (json['cryptocurrency'] as String?) ?? '',
cryptocurrencyAmount: (json['cryptocurrency_amount'] is int
? json['cryptocurrency_amount'] as int
: int.tryParse(
json['cryptocurrency_amount']?.toString() ?? '')) ??
0,
url: (json['url'] as String?) ?? '',
);
}