selectContact method Null safety

Future<Contact?> selectContact()

Method to call native code and get contact detail

Implementation

Future<Contact?> selectContact() async {
  final Map<dynamic, dynamic>? result =
      await _channel.invokeMethod('selectContact');
  if (result == null) {
    return null;
  }
  return new Contact.fromMap(result);
}