Is there a faster way to get user contacts in Flutter?

Viewed 1435

I have created a mobile app in flutter where I need to take contacts from users Phone Book. The App seems fine with few contacts in my emulator but in when I test it with my mobile (with approximately 500 contacts) the app gets really slow. It almost takes around 3-4 minutes to load all contacts. Is there a way to make this process faster or Should I follow some other strategy to grab the contacts from the users mobile. I'm very new to Flutter. I would appreciate any suggestions. Thank you.

1 Answers

Are you using the contacts_service plugin?

If so, I've managed to speed up the process by not loading the profile images, which seems to slow down things in Android.

var contacts = await PhoneBook.ContactsService.getContacts(
    withThumbnails: false,
    photoHighResolution: false,
  );

I don't know if sacrificing the avatars is an option for you. In case that is, this might help you!

Related