WindowFocus class

The WindowFocus plugin provides functionality for tracking user activity and the currently active window on the Windows platform. It is useful for applications that need to monitor user interaction with the system.

Constructors

WindowFocus.new({bool debug = false, Duration duration = const Duration(seconds: 1)})
Creates an instance of WindowFocus for tracking user activity and window focus.

Properties

hashCode int
The hash code for this object.
no setterinherited
idleThreshold Future<Duration>
Returns the currently set inactivity timeout.
no setter
isUserActive bool
no setter
onFocusChanged Stream<AppWindowDto>
no setter
onUserActiveChanged Stream<bool>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addFocusChangeListener(void listener(AppWindowDto)) StreamSubscription<AppWindowDto>
Adds a listener for active window changes.
addUserActiveListener(void listener(bool)) StreamSubscription<bool>
Adds a listener for user activity changes.
dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDebug(bool value) Future<void>
Enables or disables debug mode for the plugin.
setIdleThreshold({required Duration duration}) Future<void>
Sets the user inactivity timeout.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited