onStateChanged property
EventStream<IdleState>
get
onStateChanged
Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system.
Implementation
EventStream<IdleState> get onStateChanged =>
$js.chrome.idle.onStateChanged.asStream(($c) => ($js.IdleState newState) {
return $c(IdleState.fromJS(newState));
}.toJS);