import 'package:flutter_contacts/flutter_contacts.dart'; // Service to manage contact-related operations class ContactService { Future> fetchContacts() async { if (await FlutterContacts.requestPermission()) { return await FlutterContacts.getContacts(withProperties: true, withThumbnail: true); } return []; } Future addNewContact(Contact contact) async { await FlutterContacts.insertContact(contact); } Future toogleFavorite(Contact contact) async { contact.isStarred = !contact.isStarred; await FlutterContacts.updateContact(contact); } }