fromJson static method

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

Implementation

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

  return ChatRevenueStatistics(
    revenueByHourGraph: StatisticalGraph.fromJson(
      tdMapFromJson(json['revenue_by_hour_graph']),
    ),
    revenueGraph: StatisticalGraph.fromJson(
      tdMapFromJson(json['revenue_graph']),
    ),
    revenueAmount: ChatRevenueAmount.fromJson(
      tdMapFromJson(json['revenue_amount']),
    ),
    usdRate: ((json['usd_rate'] as num?) ?? 0.0).toDouble(),
  );
}