adaptive_foreground 0.0.2
adaptive_foreground: ^0.0.2 copied to clipboard
Flutter widget that auto-selects black or white foreground from background luminance. Includes status-bar sync and live RepaintBoundary pixel sampling.
Changelog #
All notable changes to this project will be documented in this file.
The format follows Keep a Changelog, and this project adheres to Semantic Versioning.
0.0.2 - 2026-05-08 #
Fixed #
- Shortened
pubspec.yamldescription to satisfy the pub.dev 180-character limit. - Added dartdoc comments to all public API fields (
AppAdaptiveForeground,AppButtonIosAndroid,AppIosButton) to exceed the 20 % documentation threshold.
0.0.1 - 2026-05-08 #
Added #
AppAdaptiveForegroundwidget — adaptive black/white foreground color based on background luminance, with smooth 300 msColorTweentransitions.- Hysteresis (
hysteresisparameter, default0.08) prevents status-bar icon oscillation when sampled luminance hovers near the switching threshold. - Two sampling strategies:
backgroundColorHint(instant) and live backdrop sampling via aRepaintBoundarysamplingKey. updateStatusBarflag to keepSystemUiOverlayStylein sync automatically.- Static accessors:
AppAdaptiveForeground.of,backgroundColorOf,systemStyleOf. AppButtonIosAndroid— cross-platform circular action button (native iOSCNButtonon iOS, MaterialInkWellcircle on Android).AppIosButton— thin wrapper overcupertino_native'sCNButton.icon.AppDimensions— lightweight sizing constants (no external scaling library).- MIT License.