TimeConstraint.fromJson constructor

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

Creates a new instance of TimeConstraint from a JSON object.

The JSON object should contain keys that correspond to the parameters of TimeConstraint.

Implementation

factory TimeConstraint.fromJson(Map<String, dynamic> json) {
  return TimeConstraint(
    activityDomain: json['activityDomain'],
    timeSlots: (json['timeSlots'] as List)
        .map((e) =>
            e == null ? null : TimeSlot.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}