XRPCurrencies.fromJson constructor

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

Factory method to create an instance of XRPCurrencies from JSON.

The json parameter represents the JSON data to parse. If the currency is "XRP", returns an instance of XRP. Otherwise, returns an instance of IssuedCurrency.

Implementation

factory XRPCurrencies.fromJson(Map<String, dynamic> json) {
  if (json["currency"] == "XRP") {
    return XRP();
  }
  return IssuedCurrency.fromJson(json);
}