observeContacts method

  1. @override
Stream<List<Contact>> observeContacts()
override

Observes changes to the contacts database.

Returns a stream of contact lists that updates when contacts change.

Implementation

@override
Stream<List<Contact>> observeContacts() {
  return eventChannel.receiveBroadcastStream().map(
    (event) => (event as List)
        .map<Contact>((dynamic item) => Contact.fromJson(_safeMapCast(item)))
        .toList(),
  );
}