getContact method

  1. @override
Future<Contact?> getContact(
  1. String identifier, {
  2. bool withThumbnails = true,
  3. bool withHiResPhoto = true,
  4. bool withUnifyInfo = true,
})
override

Retrieves a single contact by identifier

Implementation

@override
Future<Contact?> getContact(identifier,
    {bool withThumbnails = true,
    bool withHiResPhoto = true,
    bool withUnifyInfo = true}) async {
  final _keys = ContactKeys.of(mode, identifier);
  final fromChannel =
      await channel.invokeMethod('getContact', <String, dynamic>{
    _kidentifier: _keys.toMap(),
    _kwithThumbnails: withThumbnails,
    kwithUnifyInfo: withUnifyInfo,
    _kphotoHighResolution: withHiResPhoto,
  });
  if (fromChannel == null) return null;
  return Contact.fromMap(fromChannel, mode);
}