NftCollectionData.fromJson constructor

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

Constructs an instance of NftCollectionData from a JSON object.

json is a map containing the JSON data.

Implementation

NftCollectionData.fromJson(Map<String, dynamic> json)
    : this.id = Convert.toStr(json['id'], ''),
      this.contractAddress = Convert.toStr(json['contract_address'], ''),
      this.name = Convert.toStr(json['name'], ''),
      this.assetPlatformId = Convert.toStr(json['asset_platform_id'], ''),
      this.symbol = Convert.toStr(json['symbol'], ''),
      this.image = json.containsKey('image')
          ? ImageInfo.fromJson(json['image'])
          : null,
      this.description = Convert.toStr(json['description'], ''),
      this.nativeCurrency = Convert.toStr(json['native_currency'], ''),
      this.nativeCurrencySymbol =
          Convert.toStr(json['native_currency_symbol'], ''),
      this.floorPrice = NativeCurrencyUsdData.fromJson(json['floor_price']),
      this.marketCap = NativeCurrencyUsdData.fromJson(json['market_cap']),
      this.volume24h = NativeCurrencyUsdData.fromJson(json['volume_24h']),
      this.floorPriceInUsd24hPercentageChange = Convert.toDouble(
          json['floor_price_in_usd_24h_percentage_change'], 0),
      this.volumeInUsd24hPercentageChange =
          Convert.toDouble(json['volume_in_usd_24h_percentage_change'], 0),
      this.floorPrice24hPercentageChange = NativeCurrencyUsdData.fromJson(
          json['floor_price_24h_percentage_change']),
      this.marketCap24PercentageChange = NativeCurrencyUsdData.fromJson(
          json['market_cap_24h_percentage_change']),
      this.volume24hPercentageChange = NativeCurrencyUsdData.fromJson(
          json['volume_24h_percentage_change']),
      this.numberOfUniqueAddresses =
          Convert.toIntN(json['number_of_unique_addresses']),
      this.numberOfUniqueAddresses24hPercentageChange = Convert.toDoubleN(
          json['number_of_unique_addresses_24h_percentage_change']),
      this.totalSupply = Convert.toDouble(json['total_supply'], 0),
      this.oneDaySales = Convert.toDouble(json['one_day_sales'], 0),
      this.oneSaySales24hPercentageChange =
          Convert.toDouble(json['one_day_sales_24h_percentage_change'], 0),
      this.oneDayAverageSalePrice =
          Convert.toDouble(json['one_day_average_sale_price'], 0),
      this.oneDayAverageSalePrice24hPercentageChange = Convert.toDouble(
          json['one_day_average_sale_price_24h_percentage_change'], 0),
      this.links = NftLinksData.fromJson(json['links']),
      this.floorPrice7dPercentageChange = NativeCurrencyUsdData.fromJson(
          json['floor_price_7d_percentage_change']),
      this.floorPrice14dPercentageChange = NativeCurrencyUsdData.fromJson(
          json['floor_price_14d_percentage_change']),
      this.floorPrice30dPercentageChange = NativeCurrencyUsdData.fromJson(
          json['floor_price_30d_percentage_change']),
      this.floorPrice60dPercentageChange = NativeCurrencyUsdData.fromJson(
          json['floor_price_60d_percentage_change']),
      this.floorPrice1yPercentageChange = NativeCurrencyUsdData.fromJson(
          json['floor_price_1y_percentage_change']),
      this.explorers = _parseExplorers(json['explorers']) {}