podcast_search 0.2.2

A simple library providing programmatic access to the iTunes search API for podcasts.

Created from templates made available by Stagehand under a MIT license license.

Usage #

A simple usage example. Search for podcasts with widgets in the title and is available in the UK. Limit to at most 10 results:

import 'package:podcast_search/podcast_search.dart';

main() async {
  var search = Search();

  /// Search for the "It's a Widget" podcast.
  SearchResult results = await search.search("it's a widget",
      country: Country.UNITED_KINGDOM,
      limit: 10);

  /// List the name of each podcast found.
  results.items?.forEach((result) {
    print("Found podcast: ${result.trackName}");
  });

  /// Parse the first podcast.
  Podcast podcast = await Podcast.loadFeed(url: results.items[0].feedUrl);

  /// Display episode titles.
  podcast.episodes?.forEach((episode) {
    print("Episode title: ${episode.title}");
  });
}

0.2.2 #

  • Dropped version of Meta to prevent clash with current SDK.

0.2.1 #

  • Corrected issue with dependencies.

0.2.0 #

  • Breaking change: Renamed Podcast to Item in search results.
  • Added support for parsing a podcast RSS feed and returning podcast and episodes details.

0.1.2 #

  • Correct copyright text to fix issues with documentation.

0.1.1 #

  • Correct issues reported by health tool.

0.1.0 #

  • Initial release.

example/podcast_search_example.dart

import 'package:podcast_search/podcast_search.dart';

main() async {
  var search = Search();

  /// Search for the "It's a Widget" podcast.
  SearchResult results = await search.search("it's a widget",
      country: Country.UNITED_KINGDOM,
      limit: 10);

  /// List the name of each podcast found.
  results.items?.forEach((result) {
    print("Found podcast: ${result.trackName}");
  });

  /// Parse the first podcast.
  Podcast podcast = await Podcast.loadFeed(url: results.items[0].feedUrl);

  /// Display episode titles.
  podcast.episodes?.forEach((episode) {
    print("Episode title: ${episode.title}");
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  podcast_search: ^0.2.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:podcast_search/podcast_search.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Jul 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:podcast_search/podcast_search.dart.

Health issues and suggestions

Document public APIs. (-0.12 points)

322 out of 332 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/src/model/episode.dart.

Run dartfmt to format lib/src/model/episode.dart.

Format lib/src/model/podcast.dart.

Run dartfmt to format lib/src/model/podcast.dart.

Format lib/src/search/search.dart.

Run dartfmt to format lib/src/search/search.dart.

Format lib/src/utils/utils.dart.

Run dartfmt to format lib/src/utils/utils.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
http ^0.12.0+1 0.12.0+2
meta ^1.1.6 1.1.7
webfeed ^0.4.2 0.4.2
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
convert 2.1.1
http_parser 3.1.3
path 1.6.2
pedantic 1.8.0+1
petitparser 2.4.0
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
xml 3.5.0
Dev dependencies
test ^1.6.4

Admin