listDirectories method

Future<UriList?> listDirectories(
  1. Uri uri
)

Lists the subdirectories and files under the directory at uri.

Returns an Error if uri resolves to a FileSystemEntity that is not a Directory.

The file will be created if it does not exist, and it will be overwritten if it already does exist.

If there are unsaved changes under the directory at uri, for example, an unsaved new file from an IDE, those will be ignored.

The return value can be one of {'type': 'Success'} or an RpcException.

Implementation

Future<UriList?> listDirectories(Uri uri) async {
  final result = await call(
    DTDFileService.serviceName,
    FileSystemServiceMethods.listDirectories.name,
    params: {
      'uri': uri.toString(),
    },
  );
  return UriList.fromDTDResponse(result);
}