Rights.parse constructor

Rights.parse(
  1. Map json
)

Implementation

factory Rights.parse(Map json) {
  int? print = json.remove("print");
  int? copy = json.remove("copy");
  DateTime? start;
  if (json.containsKey("start")) {
    start = DateTime.tryParse(json.remove("start"));
  }
  DateTime? end;
  if (json.containsKey("end")) {
    end = DateTime.tryParse(json.remove("end"));
  }
  return Rights._(print, copy, start, end, json);
}