delete method
Deletes this FileSystemEntity
.
The exact details vary according to the FileSystemEntity
:
Implementation
@override
Future<Link> delete({bool recursive = false}) {
if (recursive) {
return Future.error(
UnsupportedError('Recursive flag is not supported by Node.js'));
}
final completer = Completer<Link>();
void callback(err) {
if (err != null) {
completer.completeError(err);
} else {
completer.complete(this);
}
}
final jsCallback = js.allowInterop(callback);
fs.unlink(_absolutePath, jsCallback);
return completer.future;
}