Ticker.fromJson constructor

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

Implementation

factory Ticker.fromJson(Map<String, dynamic> json) => Ticker(
      base: json["base"],
      target: json["target"],
      market: Market.fromJson(json["market"]),
      last: json["last"].toDouble(),
      volume: json["volume"].toDouble(),
      convertedLast: Map.from(json["converted_last"])
          .map((k, v) => MapEntry<String, double>(k, v.toDouble())),
      convertedVolume: Map.from(json["converted_volume"])
          .map((k, v) => MapEntry<String, double>(k, v.toDouble())),
      trustScore: json["trust_score"],
      bidAskSpreadPercentage: json["bid_ask_spread_percentage"].toDouble(),
      timestamp: DateTime.parse(json["timestamp"]),
      lastTradedAt: DateTime.parse(json["last_traded_at"]),
      lastFetchAt: DateTime.parse(json["last_fetch_at"]),
      isAnomaly: json["is_anomaly"],
      isStale: json["is_stale"],
      tradeUrl: json["trade_url"] == null ? null : json["trade_url"],
      coinId: json["coin_id"],
      targetCoinId: json["target_coin_id"],
    );