Transactions.fromJson constructor

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

Implementation

factory Transactions.fromJson(Map<String, dynamic> json) => Transactions(
      symbol: json["symbol"],
      amount: json["amount"].toDouble(),
      buyDate: json["buy_date"]?.toInt(),
      tradeDirection: json["amount"].toInt() > 0
          ? TradeDirection.buy
          : TradeDirection.sell,
    );