LocationConstraint.fromJson constructor

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

Creates a new instance of LocationConstraint from a JSON object.

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

Implementation

factory LocationConstraint.fromJson(Map<String, dynamic> json) {
  return LocationConstraint(
    isRequired: json['isRequired'],
    suggestLocation: json['suggestLocation'],
    locations: (json['locations'] as List)
        .map((e) =>
            e == null ? null : Location.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}