简体   繁体   中英

contacts_service : await ContactsService.getContacts() too slow in flutter

While using below code for fetching the contact from android device, it is taking too time to list the contacts.Is there any solutions recommended.

getContacts() async {
var contacts = await ContactsService.getContacts();
setState(() {
    _contacts = contacts;
  print("Contact List " + contacts.toList().toString());
});

}

You can increase the speed by setting the "withTumbnails" parameter to false, which in default is set to true

replace:

List<Contact> contacts = await ContactsService.getContacts();  

with

List<Contact> contacts = await ContactsService.getContacts(withThumbnails: false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM