addListener static method

void addListener(
  1. void screenshotListener()?,
  2. void screenRecordListener(
    1. bool
    )?
)

Add callback actions when screenshot or screen record events received, Supported for iOS only, do nothing when run on Android.

Implementation

static void addListener(
  void Function()? screenshotListener,
  void Function(bool)? screenRecordListener,
) async {
  _onScreenshotListener = screenshotListener;
  _onScreenRecordListener = screenRecordListener;

  _channel.setMethodCallHandler(_methodCallHandler);
  await _channel.invokeMethod('addListener');
}