unblockScreenshots static method

Future<void> unblockScreenshots()

Unblocks screenshot capture if it is currently blocked, otherwise this has no effect. Returns a Future which resolves when screenshots are effectively unblocked.

If screenshots are disabled through AgentConfiguration.screenshotsEnabled or through the controller UI, this method has no effect.

If screenshots are set to manual mode in the controller UI, this method unblocks for manual mode only.

WARNING: This will unblock capture for the entire app.

The user is expected to manage any possible nesting issues that may occur if blocking and unblocking occur in different code paths.

Method might throw Exception.

See Instrumentation.blockScreenshots.

Implementation

static Future<void> unblockScreenshots() async {
  try {
    await channel.invokeMethod<void>('unblockScreenshots');
  } on PlatformException catch (e) {
    throw Exception(e.details);
  }
}