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