getDownloadFolderItems method
Future<List<FileModel> >
getDownloadFolderItems({
- DateTime? fromDate,
- int? limit,
- bool orderByDesc = true,
- bool sortBySize = false,
- bool sortByName = false,
- String? keyword,
override
Fetches files from the Download folder with optional filters.
Implementation
@override
Future<List<FileModel>> getDownloadFolderItems({
DateTime? fromDate,
int? limit,
bool orderByDesc = true,
bool sortBySize = false,
bool sortByName = false,
String? keyword,
}) async {
final Map<String, dynamic> arguments = {
'fromDate': fromDate?.millisecondsSinceEpoch,
'limit': limit,
'orderByDesc': orderByDesc,
'sortBySize': sortBySize,
'sortByName': sortByName,
'keyword': keyword,
};
final result = await methodChannel.invokeMethod<List<dynamic>>(
'getDownloadFolderItems',
arguments,
);
return result
?.map((e) => FileModel.fromMap(Map<String, dynamic>.from(e)))
.toList() ??
[];
}