updateContact method

  1. @override
Future<Contact> updateContact(
  1. Contact contact
)
override

Updates an existing contact.

contact - The contact data with updates.

Implementation

@override
Future<Contact> updateContact(Contact contact) async {
  try {
    final result = await methodChannel.invokeMethod<dynamic>(
      'updateContact',
      contact.toJson(),
    );

    return Contact.fromJson(_safeMapCast(result));
  } on PlatformException catch (e) {
    throw Exception('Failed to update contact: ${e.message}');
  }
}