📞 Flutter Contacts
Description
Aurora OS implementation of Flutter Contacts plugin. Supports reading contacts list with basic information about contacts.
The plugin allows you to:
- get information about contacts, such as:
- name, including first, middle, last names, nickname and display name
- list of phone numbers with their type (work, home, and etc.)
- avatar
- subscribe to changes in contacts list made by user in the system application
Aurora OS versions compatibility
Compatible with Aurora OS versions 5.1.5 and higher.
Example
import 'package:flutter_contacts/flutter_contacts.dart';
// Request permissions
final status = await FlutterContacts.permissions.request(PermissionType.readWrite);
if (status == PermissionStatus.granted) {
// Get all contacts (fast - defaults to IDs and display names only)
List<Contact> contacts = await FlutterContacts.getAll();
// Subscribe to changes in contacts list made by user in system application.
FlutterContacts.onContactChange.listen((changes) {
for (final c in changes) {
print('Contact ${c.type.name}: ${c.contactId}');
}
});
}