openContactEditForm method

  1. @override
Future<Contact?> openContactEditForm(
  1. dynamic identifier
)
override

Opens a native edit form for the contact with identifier. This can be a simple string, but you can also provide a ContactKeys instance

Implementation

@override
Future<Contact?> openContactEditForm(dynamic identifier) async {
  final contactKey = ContactKeys.of(mode, identifier);
  final map = await channel.invokeMethod(
      'openContactEditForm', {"identifier": contactKey.toMap()});
  if (map["success"] == true) {
    final contact = Contact.of(map["contact"] ?? <String, dynamic>{}, mode);
    _log.info("Saved contact: ${contact?.identifier}");
    return contact;
  } else {
    _log.info("Contact form was not saved: ${map["code"] ?? 'unknown'}");
    return null;
  }
}