Holding.fromJson constructor

Holding.fromJson(
  1. String json
)

Implementation

Holding.fromJson(String json) {
  List<String> segments = json.split(" ");
  if (segments.length != 2) {
    return;
  }
  this.amount = double.parse(segments[0]);
  this.currency = segments[1];
}