Event.parse constructor

Event.parse(
  1. Map json
)

Implementation

factory Event.parse(Map json) {
  try {
    String name = json["name"];
    DateTime date = DateTime.parse(json["timestamp"]);
    String type = json["type"];
    String id = json["id"];
    return Event._(type, name, id, date);
  } on Exception {
    throw Exception(LcpParsingError.errorDescription(LcpParsingErrors.json));
  }
}