detectFakeLocation method

Future<bool> detectFakeLocation()

Implementation

Future<bool> detectFakeLocation() async {
  bool result = false;
  if (await Permission.location.isGranted) {
    result = await mothodChannel.invokeMethod('detectFakeLocation');
    return result;
  } else {
    PermissionStatus status = await Permission.locationWhenInUse.request();
    if (status == PermissionStatus.granted) {
      result = await mothodChannel.invokeMethod('detectFakeLocation');
      return result;
    } else if (status == PermissionStatus.permanentlyDenied) {
      return false;
    } else {
      return false;
    }
  }
}