setIdleThreshold method

Future<void> setIdleThreshold({
  1. required Duration duration,
})

Sets the user inactivity timeout.

If the user is inactive for the specified duration, the plugin sends an event indicating user inactivity.

  • duration: The time in milliseconds after which the user is considered inactive.
await _windowFocus.setIdleThreshold(Duration(seconds: 10));

Implementation

Future<void> setIdleThreshold({required Duration duration}) async {
  await _channel.invokeMethod('setInactivityTimeOut',  {
    'inactivityTimeOut': duration.inMilliseconds,
  });
}