Use the FilesSystemEntity delete() method to delete a file, directory, or symlink. This method is inherited by File, Directory, and Link.
import 'dart:io'; main() async { // Create a temporary directory. var dir = await Directory.systemTemp.createTemp('my_temp_dir'); // Confirm it exists. print(await dir.exists()); // Delete the directory. await dir.delete(); // Confirm it no longer exists. print(await dir.exists()); }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129482