getAllAudios method
Future<List<AudioModel> >
getAllAudios({
- DateTime? fromDate,
- int? limit,
- bool orderByDesc = true,
- bool sortBySize = false,
- bool sortByName = false,
- String? keyword,
override
Fetches all audios from the device with optional filters.
Implementation
@override
Future<List<AudioModel>> getAllAudios({
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>>(
'getAllAudios',
arguments,
);
return result
?.map((e) => AudioModel.fromMap(Map<String, dynamic>.from(e)))
.toList() ??
[];
}