idleThreshold property

Future<Duration> get idleThreshold

Returns the currently set inactivity timeout.

Returns: A Duration that specifies the time after which the user is considered inactive.

final timeout = await _windowFocus.getIdleThreshold();
print('Inactivity timeout: ${timeout.inSeconds} seconds');

Implementation

Future<Duration> get idleThreshold async {
  final res = await _channel.invokeMethod<int>('getIdleThreshold');
  print(res);
  return Duration(milliseconds: res ?? 60);
}