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');
}
}
扫一扫
在手机上阅读