checkScreenCaptureServiceRunning static method

Future<bool> checkScreenCaptureServiceRunning()

Check if the screen capture service is currently running.

This queries the native side for the current state.

Implementation

static Future<bool> checkScreenCaptureServiceRunning() async {
  if (kIsWeb) {
    return true;
  }

  try {
    final result =
        await _channel.invokeMethod<bool>('isScreenCaptureServiceRunning');
    _isServiceRunning = result ?? false;
    return _isServiceRunning;
  } on PlatformException catch (e) {
    debugPrint('Failed to check screen capture service: ${e.message}');
    return false;
  } on MissingPluginException {
    return true;
  }
}