device_screen_brightness 0.3.1
device_screen_brightness: ^0.3.1 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.3.1 #
- Add
example/linuxscaffolding and update.metadata.
0.3.0 #
- macOS: DDC/CI support for third-party external monitors via the private
IOAVServiceAPI (Apple Silicon Macs, USB-C / Thunderbolt / DisplayPort Alt-Mode connections). Based on the open-source m1ddc project (MIT). - macOS backend now auto-selects at runtime:
DisplayServicesfor Apple native displays (built-in, Studio Display, Pro Display XDR).IOAVServiceDDC/CI for third-party external monitors — falls back toBackendNotAvailableExceptionwhen neither backend is reachable.
macos/device_screen_brightness.podspec: addedIOKittos.frameworks.- README macOS section updated to document both backends and their limitations.
0.2.1 #
- README translated fully to English; macOS and Linux platform notes expanded.
spec_device_screen_brightness.mdexcluded from version control via.gitignore.windows/CMakeLists.txtcorrected toLANGUAGES C(wasCXX).- CI: added
test,build-macosjobs;dry-runnow depends onanalyze.
0.2.0 #
BrightnessModeenum — all brightness methods now accept an optionalmodeparameter (BrightnessMode.apporBrightnessMode.system).BrightnessMode.app(Android): adjusts the current Activity window brightness — no permission required.BrightnessMode.system(Android, default): writesSettings.System.SCREEN_BRIGHTNESS— requiresWRITE_SETTINGS.- On iOS, macOS, Linux and Windows the parameter is ignored.
- Added
hasPermission()andrequestPermission()— AndroidWRITE_SETTINGShelpers (no-op on other platforms). - Updated example app with a
SegmentedButtonto toggle between app and system mode.
0.1.0 #
- Unified C API:
device_screen_brightness_get,_set,_increment,_decrement. - Backend pattern:
DeviceScreenBrightnessBackendabstract class withFfiBackendandAndroidBackend. - All brightness values normalized to int 0–100.
abstract final class DeviceScreenBrightnesspublic facade.streamBrightness()with 250 ms polling.*Computevariants viaFlutter.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.