readFromFile method

Future<Stream<List<int>>> readFromFile (
  1. String root,
  2. String path
)

Implementation

Future<Stream<List<int>>> readFromFile(String root, String path) {
    path = normalize(path);
    return FileSystemEntity.isFile(root + path).then((exists) {
      if (exists) {
        return new File(root + path).openRead();
      } else {
        var error = new AssistentError("Asset '$path' not found");
        return new Future.error(error);
      }
    });
  }