fromJson static method

ChatRevenueTransaction? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static ChatRevenueTransaction? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return ChatRevenueTransaction(
    cryptocurrency: (json['cryptocurrency'] as String?) ?? '',
    cryptocurrencyAmount: (json['cryptocurrency_amount'] is int
            ? json['cryptocurrency_amount'] as int
            : int.tryParse(
                json['cryptocurrency_amount']?.toString() ?? '')) ??
        0,
    type: ChatRevenueTransactionType.fromJson(
        json['type'] as Map<String, dynamic>?)!,
  );
}