我需要使用File类,这个类在web和html中是不同的(就我所理解的而言
我希望能够做到
import if (dart.library.io) 'dart:io' if (dart.library.io) 'dart:html';但这不管用。
从移动应用程序上的dart:io和web上的dart:html读取文件的解决方案是什么?
谢谢
发布于 2021-05-28 18:51:11
cross_file包可以为您提供帮助。或者您可以使用条件导入,如下所示:
import 'dart:io' if (dart.library.html) 'dart:html';https://stackoverflow.com/questions/67732006
复制相似问题