fromJson static method
Implementation
static ChatRevenueAmount? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return ChatRevenueAmount(
cryptocurrency: (json['cryptocurrency'] as String?) ?? '',
totalAmount: (json['total_amount'] is int
? json['total_amount'] as int
: int.tryParse(json['total_amount']?.toString() ?? '')) ??
0,
balanceAmount: (json['balance_amount'] is int
? json['balance_amount'] as int
: int.tryParse(json['balance_amount']?.toString() ?? '')) ??
0,
availableAmount: (json['available_amount'] is int
? json['available_amount'] as int
: int.tryParse(json['available_amount']?.toString() ?? '')) ??
0,
withdrawalEnabled: (json['withdrawal_enabled'] as bool?) ?? false,
);
}