getContacts method
/ 1.
Implementation
@override
Future<List<Contact>> getContacts({
DateTime? fromDate,
int? limit,
bool orderByDesc = true,
}) async {
// debugPrint("👉🏻 getContacts called");
final Map<String, dynamic> arguments = {
'fromDate': fromDate?.millisecondsSinceEpoch,
'limit': limit,
'orderByDesc': orderByDesc,
};
final result = await methodChannel.invokeMethod<List>(
'getContacts',
arguments,
);
// debugPrint("👉🏻 getContacts result: $result");
if (result == null) return [];
var convertedIntoModel = result.map((e) {
final map = Map<String, dynamic>.from(e as Map);
return Contact.fromMap(map);
}).toList();
return convertedIntoModel;
}