Closed ParitoshBh closed 5 years ago
As a workaround, you can fetch all contacts and then filter them based on the phone number values : Something like this could work :
var allContacts = await ContactsService.getContacts();
var filtered = allContacts.where((c) => c.phones.any((phone) => phone.value.contains("123456789"))).toList();
That was my first thought but from a performance stand point would this be slower than using something like ContactsContract.PhoneLookup
?
Yes I guess that would be more performant, especially if you have 100's of contacts. I doubt i will be adding this to the library any time soon though. PRs are welcome :)
I will try to push a PR as and when I get time :)
Closing this issue due to lack of interest from the community to lookup a phone number. If someone would like to contribute I will re-open this issue. Thanks!
They contact query (by name, I am guessing) works very well. However, is there a way to lookup contact(s) based on a phone number?
I understand this isn't something on your to-do list but it'd be great to know if there's a way to do so in library's current state?