search method

Future<SearchResult> search(
  1. String term, {
  2. Country country = Country.none,
  3. Attribute attribute = Attribute.none,
  4. String language = '',
  5. int limit = 0,
  6. int version = 0,
  7. bool explicit = false,
  8. Map<String, dynamic> queryParams = const {},
})

Search iTunes using the term term. You can limit the results to podcasts available in a specific country by supplying a Country option. By default, searches will be based on keywords. Supply an Attribute value to search by a different attribute such as Author, genre etc.

Implementation

Future<SearchResult> search(
  String term, {
  Country country = Country.none,
  Attribute attribute = Attribute.none,
  String language = '',
  int limit = 0,
  int version = 0,
  bool explicit = false,
  Map<String, dynamic> queryParams = const {},
}) async {
  _term = term;
  _country = country;
  _attribute = attribute;
  _limit = limit;
  _language = language;
  _version = version;
  _explicit = explicit;

  var s = (searchProvider is ITunesProvider)
      ? ITunesSearch(
          userAgent: userAgent,
          timeout: timeout,
        )
      : PodcastIndexSearch(
          userAgent: userAgent,
          timeout: timeout,
          podcastIndexProvider: searchProvider as PodcastIndexProvider,
        );

  return s.search(
      term: term,
      country: _country,
      attribute: _attribute,
      language: _language,
      limit: _limit,
      version: _version,
      explicit: _explicit,
      queryParams: queryParams);
}