TimeSlot.fromJson constructor

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

Creates a new instance of TimeSlot from a JSON object.

The JSON object should contain keys "start" and "end" that correspond to the parameters of TimeSlot.

Implementation

factory TimeSlot.fromJson(Map<String, dynamic> json) {
  return TimeSlot(
    start: json['start'] == null
        ? null
        : Time.fromJson(json['start'] as Map<String, dynamic>),
    end: json['end'] == null
        ? null
        : Time.fromJson(json['end'] as Map<String, dynamic>),
  );
}