deleteDir function

Future<void> deleteDir(
  1. String path,
  2. {bool recursive = true}
)

Deletes the directory located at path.

If recursive is true (default true) then the directory and all child files and directories will be deleted.

deleteDir("/tmp/testing", recursive=true);

If path is not a directory then a DeleteDirException is thrown.

If the directory does not exists a DeleteDirException is thrown.

If the directory cannot be delete (e.g. permissions) a DeleteDirException is thrown.

If recursive is false the directory must be empty otherwise a DeleteDirException is thrown.

See isDirectory exists

Implementation

Future<void> deleteDir(String path, {bool recursive = true}) async =>
    _DeleteDir().deleteDir(path, recursive: recursive);