void addTextFile(String name, String url)

Source

void addTextFile(String name, String url) {
  var loader = HttpRequest.getString(url).then((text) => text, onError: (error) {
    throw new StateError("Failed to load text file.");
  });
  _addResource("TextFile", name, url, loader);
}