getResultsByCityName method

Future<SearchResults> getResultsByCityName(
  1. String cityName
)

Fetch Search/Autocomplete API data by city name.

Implementation

Future<SearchResults> getResultsByCityName(String cityName) async {
  List<dynamic>? jsonResponse =
      await _sendRequest<List<dynamic>>(APIType.search, cityName: cityName);

  return SearchResults(jsonResponse!);
}