getFileList method
获取文件列表
dir
可选, 如果指定了该参数, 则返回指定目录下的文件列表,
否则返回用户的根目录下的文件列表, 这个参数必须是一个绝对路径,
以 / 开头,来源通常是 FileItem.path
其他请求参数查看官方文档: https://pan.baidu.com/union/doc/nksg0sat9 ,并放入otherParams
Implementation
Future<FileList> getFileList({
String? dir,
BaiduOrder order = BaiduOrder.name,
bool desc = false,
int? start,
int? end,
int limit = 1000,
Map<String, String> otherParams = const {},
}) async {
final params = <String, String>{...otherParams};
_addCommonParams(
params: params,
order: order,
desc: desc,
start: start,
end: end,
limit: limit,
);
if (dir != null) {
params['dir'] = dir;
}
final map = await _get('rest/2.0/xpan/file', params: {
'method': 'list',
...params,
});
return FileList.fromJson(map);
}