QuerySuggestionRequest.fromMap constructor

QuerySuggestionRequest.fromMap(
  1. Map map
)

Implementation

factory QuerySuggestionRequest.fromMap(Map<dynamic, dynamic> map) {
  return QuerySuggestionRequest(
    query: map['query'] ?? (throw ('A query must be provided.')),
    location:
        map['location'] != null ? Coordinate.fromMap(map['location']) : null,
    radius: map['radius'],
    bounds: map['bounds'] == null
        ? null
        : CoordinateBounds.fromMap(map['bounds']),
    poiTypes: map['poiTypes'] != null
        ? List<LocationType>.from(
            map['poiTypes']?.map((dynamic x) => LocationType.fromString(x)),
          )
        : null,
    countryCode: map['countryCode'],
    language: map['language'],
    children: map['children'],
    strictBounds: map['strictBounds'],
    countries: map['countries'] != null
        ? List<String>.from(map['countries']?.map((dynamic x) => x?.toString))
        : null,
  );
}