PlaceAutocompleteRequestOptions constructor
PlaceAutocompleteRequestOptions({})
Implementation
PlaceAutocompleteRequestOptions({
this.components,
this.language,
this.location,
this.offset,
this.origin,
this.radius,
this.region,
this.sessiontoken,
this.strictbounds,
this.types,
}) {
if (offset != null && offset! < 0) {
throw ArgumentError('Offset cannot be negative');
}
if (radius != null && radius! <= 0) {
throw ArgumentError('Radius must be greater than zero');
}
if (components != null && components!.length > 5) {
throw ArgumentError('Components cannot contain more than 5 countries');
}
if (types != null && types!.length > 5) {
throw ArgumentError('Types cannot contain more than 5 types');
}
if (location != null && radius == null) {
throw ArgumentError(
'Radius must be specified when location is specified');
}
}