newFromURL method

Future<Show> newFromURL (String uri)

Creates a new Show from an RSS url.

Gathers information from the XML response and creates handy getters to make it simple to interact with.

Implementation

static Future<Show> newFromURL(String uri) async {
  if (uri == null) throw Exception("URL cannot be null");
  final rssResponse = await http.get(uri);
  try {
    var document = parse(rssResponse.body);
    var show = Show();
    show.doc = document;
    return show;
  } catch (e) {
    print("ERROR: Could not parse response body. Here's the deets: \n${e.message}");
  }
  return null;
}