Use the File readAsString() method to read a file as a string.
import 'dart:io'; main() async { var contents = await new File('file.txt').readAsString(); print(contents); }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129452
Use the File readAsString() method to read a file as a string.
import 'dart:io'; main() async { var contents = await new File('file.txt').readAsString(); print(contents); }
上一篇: 读取目录下的文件列表
下一篇:把数据流写到文件中