initFromURL method

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