screen_state 0.0.4 screen_state: ^0.0.4 copied to clipboard
A plugin for reporting screen events while the flutter application is running in background. Works for Android only.
screen_state #
A Flutter plugin for tracking the screen state.
Install #
Add screen_state
as a dependency in pubspec.yaml
.
For help on adding as a dependency, view the documentation.
Example Usage #
Instantiate a Screen object (no parameters needed):
Screen screen = new Screen();
Screen State events can be streamed by calling the listen()
method on a Screen
object, using an onData method for handling incoming events:
screen.listen(onData);
An example of the onData()
method is:
onData(ScreenStateEvent event) {
print(event);
}
The subscription can be cancelled again, by invoking the cancel
method:
screen.cancel();