Hi everyone!
I am trying to get access and list all contacts from phone.
I am using flutter_contacts https://pub.dev/packages/flutter_contacts
I have trouble to list displayName and phone number in a Listview.
My action custom code as JSON return value
// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:flutter_contacts/flutter_contacts.dart';
Future<dynamic> listContactFromPhoneBook() async {
// create action will list contacts from phone book
List<Contact> contacts =
await FlutterContacts.getContacts(withProperties: true, withPhoto: false);
return contacts;
}
I got the contact phone list but I want to bind displayName and phone.