Skip to main content

magic_device 0.0.1 copy "magic_device: ^0.0.1" to clipboard
magic_device: ^0.0.1 copied to clipboard

PlatformmacOS

Device signals for Flutter, whether the device is on mains power, whether the viewer is away, and the macOS window fullscreen state.

Changelog #

All notable changes to this project will be documented in this file.

[Unreleased] #

0.0.1 - 2026-10-29 #

Added #

  • DevicePower: whether the device is on mains power (charging) and whether the viewer is away (idle). Desktop idle polls the OS last-input clock; mobile idle follows the app lifecycle, seeded from the current lifecycle state at start() so an app started in the background reads idle at once. television is an injectable predicate that defaults to () => false.
  • WindowFullscreen: whether the macOS window is fullscreen (active), where it is going (target, moved by AppKit's will-notification) and whether it is animating (transitioning), with toggle() to flip it. A press that the window never answers (AppKit ignores the call for an app that is not frontmost) ends after pressTimeout and re-reads the window, so it cannot hold every later toggle. One shared instance; listeners hear each change, whether it came from toggle(), the window's green button, Esc or the Window menu. available is true on macOS only. The native half is a macOS plugin (MagicDevicePlugin, channel magic_device/window) that finds the window holding the Flutter view on each call, so the host's Runner needs no edit.
  • BatteryState is exported from the barrel. DevicePower's batteryState reader returns it, so a host that supplies its own reader names the type without adding battery_plus as a direct dependency.
0
likes
160
points
58
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Device signals for Flutter, whether the device is on mains power, whether the viewer is away, and the macOS window fullscreen state.

Homepage
Repository (GitHub)
View/report issues

Topics

#battery #idle #power #magic #flutter

License

MIT (license)

Dependencies

battery_plus, flutter, flutter_inactive_timer

More

Packages that depend on magic_device

Packages that implement magic_device