【发布时间】:2016-05-11 21:21:15
【问题描述】:
我正在尝试为一些 dart:html 代码编写测试。
我有一个带有 File 参数的方法(html 文件,而不是 io 文件)。
testFile(File file)
我可以使用文件所需的数据(减去文件名、日期等)创建一个 Blob,但似乎无法在 dart:html 中创建 File 对象,因为它是为内部保留的在 html_dartium.dart 中使用。
factory File._() { throw new UnsupportedError("Not supported"); }
还有其他方法可以创建 HTML File 对象吗?
我见过提到的 FileReaders,但结果要么是 String 要么是 uint8list。
【问题讨论】: