UGoldUserBalanceResponse.fromMap constructor
UGoldUserBalanceResponse.fromMap(
- Map<String, dynamic> json
)
Implementation
factory UGoldUserBalanceResponse.fromMap(Map<String, dynamic> json) => UGoldUserBalanceResponse(
balance: json["balance"] == null ? 0 : (json["balance"] as num).toDouble(),
baseUnitPrice: json["baseUnitPrice"] == null ? null : (json["baseUnitPrice"] as num).toDouble(),
buyUnitPrice: json["buyUnitPrice"] == null ? null : (json["buyUnitPrice"] as num).toDouble(),
sellUnitPrice: json["sellUnitPrice"] == null ? null : (json["sellUnitPrice"] as num).toDouble(),
canBuy: json["canBuy"] ?? false,
canSell: json["canSell"] ?? false,
value: json["value"] == null ? null : (json["value"] as num).toDouble(),
unit: json["unit"],
priceError: json["priceError"],
updatedAt: json["updatedAt"] == null ? null : DateTime.parse(json["updatedAt"]),
);