openDeviceContactPicker static method

Future<Contact?> openDeviceContactPicker({
  1. bool iOSLocalizedLabels = true,
  2. bool androidLocalizedLabels = true,
})

Implementation

static Future<Contact?> openDeviceContactPicker(
    {bool iOSLocalizedLabels = true,
    bool androidLocalizedLabels = true}) async {
  dynamic result = await _channel
      .invokeMethod('openDeviceContactPicker', <String, dynamic>{
    'iOSLocalizedLabels': iOSLocalizedLabels,
    'androidLocalizedLabels': androidLocalizedLabels,
  });
  // result contains either :
  // - an List of contacts containing 0 or 1 contact
  // - a FormOperationErrorCode value
  if (result is List) {
    if (result.isEmpty) {
      return null;
    }
    result = result.first;
  }
  return _handleFormOperation(result);
}