get method

Future<List<Contact>> get()

Fetches contacts stored on the SIM card.

Android only. Throws PlatformException on other platforms.

Implementation

Future<List<Contact>> get() async {
  if (!Platform.isAndroid) {
    throw PlatformException(
      code: 'not_available',
      message: 'SIM API is not available on this platform.',
    );
  }
  final result = await _channel.invokeMethod<List>('sim.get');
  return JsonHelpers.decodeList(result, Contact.fromJson);
}