CompanyProfile.fromJson constructor

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

Implementation

factory CompanyProfile.fromJson(Map<String, dynamic> json) => CompanyProfile(
      currency: json["currency"],
      zip: json["zip"],
      ipo: json["ipo"] == null
          ? DateTime.parse("1970-01-01")
          : DateTime.parse(json["ipo"]),
      sector: json["sector"] ?? "N/A",
      industry: json["industry"] ?? "N/A",
      employeeTotal: json["employeeTotal"]?.toInt() ?? 0,
      marketCapitalization:
          (json["marketCapitalization"]?.toDouble() ?? 0) / (1000 * 1000),
      country: json["country"],
      beta: json["beta"].toDouble(),
      changes: json["changes"].toDouble(),
      state: json["state"],
      city: json["city"],
      volAvg: json["volAvg"].toDouble(),
      exchangeShortName: json["exchangeShortName"],
      cusip: json["cusip"],
      isFund: json["isFund"],
      defaultImage: json["defaultImage"],
      isEtf: json["isEtf"],
      phone: json["phone"],
      website: json["website"],
      isActivelyTrading: json["isActivelyTrading"],
      symbol: json["symbol"],
      companyName: json["companyName"],
      dcf: json["dcf"]?.toDouble(),
      lastDiv: json["lastDiv"]?.toDouble(),
      isin: json["isin"],
      range: json["range"],
      isAdr: json["isAdr"],
      dcfDiff: json["dcfDiff"]?.toDouble(),
      exchange: json["exchange"],
      description: json["description"],
      price: json["price"]?.toDouble(),
    );