import 'dart:io';
main() async {
final filename = 'non_existent_file.txt';
try {
var file = await new File(filename).readAsString();
print(file);
} catch (e) {
print('There was a ${e.runtimeType} error');
print('Could not read $filename');
}
}
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129497