fromJSON static method

Weight fromJSON(
  1. Map<String, dynamic> data
)

Implementation

static Weight fromJSON(Map<String, dynamic> data) {
  return Weight(
    weight: data["weight"],
    weightUnit: data["weightUnit"] != null ? weightUnitFromString(data["weightUnit"]) : null,
    date: data["date"] != null ? DateTime.parse(data["date"]) : null
  );
}