Use the File create() method to create a file. To create intermediate directories, set the recursive argument to true (default is false).
import 'dart:io'; main() async { // Get the system temp directory. var systemTempDir = Directory.systemTemp; // Creates dir/, dir/subdir/, and dir/subdir/file.txt in the system // temp directory. var file = await new File('${systemTempDir.path}/dir/subdir/file.txt') .create(recursive: true); print(file.path); }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129472