device_screen_brightness 0.2.0 copy "device_screen_brightness: ^0.2.0" to clipboard
device_screen_brightness: ^0.2.0 copied to clipboard

Control the screen brightness from Flutter. Provides getBrightness, setBrightness, incrementBrightness, decrementBrightness and streamBrightness with synchronous and compute-based async variants. Uses [...]

0.2.0 #

  • BrightnessMode enum — all brightness methods now accept an optional mode parameter (BrightnessMode.app or BrightnessMode.system).
    • BrightnessMode.app (Android): adjusts the current Activity window brightness — no permission required.
    • BrightnessMode.system (Android, default): writes Settings.System.SCREEN_BRIGHTNESS — requires WRITE_SETTINGS.
    • On iOS, macOS, Linux and Windows the parameter is ignored.
  • Added hasPermission() and requestPermission() — Android WRITE_SETTINGS helpers (no-op on other platforms).
  • Updated example app with a SegmentedButton to toggle between app and system mode.

0.1.0 #

  • Unified C API: device_screen_brightness_get, _set, _increment, _decrement.
  • Backend pattern: DeviceScreenBrightnessBackend abstract class with FfiBackend and AndroidBackend.
  • All brightness values normalized to int 0–100.
  • abstract final class DeviceScreenBrightness public facade.
  • streamBrightness() with 250 ms polling.
  • *Compute variants via Flutter.compute.
  • 6 typed exceptions: UnsupportedOperationException, InvalidBrightnessValueException, NativeBackendException, BrightnessObservationException, BackendNotAvailableException, PermissionDeniedException.
  • iOS: UIScreen.mainScreen.brightness (UIKit).
  • macOS: IOKit (IODisplayGetFloatParameter).
  • Linux: sysfs backlight (no external dependencies).
  • Windows: Physical Monitor API (dxva2).
  • Android: Settings.System via JNIgen.
  • CI: analyze, dry-run, build-linux, build-windows.
  • CD: OIDC Trusted Publisher via dart-lang/setup-dart.
2
likes
0
points
52
downloads

Publisher

unverified uploader

Weekly Downloads

Control the screen brightness from Flutter. Provides getBrightness, setBrightness, incrementBrightness, decrementBrightness and streamBrightness with synchronous and compute-based async variants. Uses JNIgen on Android and FFI + FFIgen on iOS, macOS, Linux and Windows.

Repository (GitHub)
View/report issues

Topics

#brightness #screen #ffi #platform

License

unknown (license)

Dependencies

flutter, jni, plugin_platform_interface

More

Packages that depend on device_screen_brightness

Packages that implement device_screen_brightness