hasPermission method

  1. @override
Future<bool> hasPermission()
override

Checks whether the READ_PHONE_STATE Permission is granted

Note:

  • Call this function before the getSimCards function to ensure the permission is granted

Implementation

@override
Future<bool> hasPermission() async {
  bool? hasPermission =
      await methodChannel.invokeMethod<bool>('hasPermission');
  return hasPermission ?? false;
}