searchByQueryNameQueryTypes method

Future<List<Place>> searchByQueryNameQueryTypes(
  1. String name, [
  2. List<String>? types
])

Gets all places that matches the given query

Implementation

Future<List<Place>> searchByQueryNameQueryTypes(
  String name, [
  List<String>? types,
]) async {
  final response = await _context.client.get(
    Uri.https(
      authority,
      '/place/search',
      {
        'name': name,
        if (types != null) 'types': types.join(','),
      },
    ),
  );

  ClientException.checkIsSuccessStatusCode(response);

  return Place.listFromJson(json.decode(response.body));
}