fetchNearbySearch method
Nearby search
Implementation
Future<List<MFPlaceResult>> fetchNearbySearch(
MFLocationComponent location,
int radius, {
String? text,
List<String>? types,
List<String>? tags,
DateTime? datetime,
}) async {
final Map<String, Object> data = <String, Object>{
'location': location.toJson(),
'radius': radius,
};
if (text != null) {
data['text'] = text;
}
if (types != null) {
data['types'] = types;
}
if (tags != null) {
data['tags'] = tags;
}
if (datetime != null) {
data['datetime'] = datetime.millisecondsSinceEpoch;
}
final response =
await _ServicesChannel.invokeService('place#nearby-search', data);
validateResponse(response);
return toListPlace(response!['result']);
}