ios_battery_indicator 1.7.0
ios_battery_indicator: ^1.7.0 copied to clipboard
A Flutter widget that replicates the native iOS battery indicator, including support for iOS 27 style and automatic system battery monitoring.
1.7.0 #
- ๐ Bundle the
SF Profont (./fonts/SF-Pro.ttf) so the indicator uses it natively on every platform. - ๐จ Use
SF Proin the indicator'sDefaultTextStyle. - ๐จ Simplify percentage text font weight.
1.6.4 #
- ๐ Add inline width style to the README banner image for consistent rendering.
1.6.2 #
- ๐ Percentage text now inherits the parent
DefaultTextStylefor correct font and glyph metrics.
1.6.1 #
- ๐จ
_buildBoltnow inherits the parentDefaultTextStylefor correct glyph metrics. - ๐จ Tweaked the bolt icon scaling for better visual alignment.
1.6.0 #
- ๐จ
BatteryIndicatorTheme: addchargingTrackColor,criticallyLowTrackColor, andsaveModeTrackColor(optional, with Cupertino defaults) to customize the track color for charging, critically-low, and battery-save-mode states. - ๐ง
_trackColornow reads these states' colors fromBatteryIndicatorThemeinstead of hardcodedCupertinoColors.
1.5.1 #
- ๐จ At 100%, drop
tabularFiguresfromfontFeatureswhile keeping other features. - ๐จ Simplify percentage text font weight.
- ๐ Document
fontFeaturesand its 100% behavior.
1.5.0 #
- โจ Add configurable
fontFeaturesfor the battery percentage text (defaultconst [FontFeature.tabularFigures()]); only effective whenshowBatteryPercentageistrue.
1.4.7 #
- ๐จ More native-proportioned battery; text, bolt, and positive pole now scale with the indicator size
- ๐จ Cleaner percentage text and more reliable vertical centering across platforms
- ๐จ More visible low-battery fill and a clearer charging-bolt cutout effect
- ๐ง Tighter corner-radius handling for consistent classic and iOS 27 styles
1.4.6 #
- ๐ง Key the new rounded radius to iOS 26 detection; tidy up
_checkIosVersion
1.4.5 #
- ๐จ Use a solid fill in low-power (battery save) mode, matching the charging and critically-low states
1.4.4 #
- ๐จ Don't squeeze the percentage text while charging at 100% (only squeeze when not full)
1.4.3 #
- ๐จ Taller classic (non-iOS 27) battery โ height
14instead of13when the percentage is shown, for better text proportion - ๐จ Tighten corner radii for the classic style (outer
3.2/ inner1.6vs4/2) to better match the native pre-iOS 27 look - ๐จ Scale the percentage text and bolt icon to the battery height for consistent proportions
- ๐จ Use
w800font weight for the percentage text in the classic style (previously only at 100%) - ๐จ Slightly squeeze the percentage text (
scaleX: .9) and tighten row spacing while charging in the classic style
1.4.2 #
- ๐จ Use
.38light-themebgColoralpha for non-iOS 27 outline (.28for iOS 27 fill) - ๐จ Add
.5inset padding to the classic (non-iOS 27) battery style
1.4.1 #
- ๐ Fix percentage text display on macOS
1.4.0 #
- โจ Add configurable
batteryLevelPollIntervalfor the battery-level poll in system mode (default 30s)
1.3.0 #
- โจ Add
monitorBatterySaveModeto poll Low Power Mode at runtime whenisInBatterySaveModeisnull, with configurablesaveModePollInterval(default 30s)
1.2.7 #
- ๐จ Shrink fill bar height at low battery (< 20%) in classic style to match corner radius
- ๐ Fix
AnimatedSwitcherkey for classic style so charging/bolt transitions animate - โจ Use
w800font weight at 100%,w700otherwise, for percentage text
1.2.6 #
- ๐ฌ Unify crossfade animation for both iOS 27 and non-iOS 27 styles in basic battery mode
1.2.5 #
- ๐จ Restore cutout percentage style when battery is full โ plain fill now only applies when charging or critically low
- ๐จ Use
FontFeature.tabularFigures()for percentage text to prevent digit-width jitter - ๐จ Shrink positive pole diameter from 4.2 to 3.9 for better visual proportion
- ๐จ Prevent "100" text overflow by reducing scale when battery is full
- ๐จ Reduce minimum fill bar from 5% to 2% for more accurate low-level display
1.2.4 #
- ๐ Fix screenshot images and language link in README โ use absolute GitHub URLs so they render correctly on pub.dev
1.2.3 #
- ๐ฆ Add
platformsdeclaration topubspec.yamlfor all supported platforms
1.2.2 #
- ๐จ Refine battery indicator layout and fill animation for smoother, more polished appearance
- ๐ Fix
chargingWithBoltdisplay logic - ๐งน Simplify positive pole color logic by delegating to
_trackColor(theme)
1.2.1 #
- ๐จ Refine percentage text rendering: increase font size from 12 to 13, remove letter spacing for cleaner appearance
- ๐จ Adjust bolt icon size from 10 to 9.6 for better visual balance with percentage text
- ๐จ Remove
Transform.scalewrappers from percentage text and cutout mask, usePaddinginset instead for more predictable layout
1.2.0 #
- ๐ New
playChargingSoundparameter โ optionally play the native iOS charging sound (connectedToPower) when entering the charging state in manual mode. Uses the ios_system_sound package and is only supported on iOS. Disabled by default.
1.1.0 #
- ๐ก New callbacks โ added
onBatteryLevelChangedandonBatteryStateChangedto receive real-time system battery updates in auto mode - ๐ Fix percentage text vertical misalignment by applying
TextHeightBehaviorto suppress extra ascent/descent
1.0.3 #
- ๐ฌ Added
animationDurationparameter to control all indicator animations, including fill progress, color changes, bolt icon, and crossfade transitions - ๐จ Fix cutout percentage text overflow by wrapping
maskChildwithFittedBoxfor proper scaling
1.0.2 #
- ๐จ Adjust text rendering: wrap battery indicator in
DefaultTextStylewithheight: 1andfontWeight: .w500for consistent typography - ๐จ Refine cutout percentage font size from 14 to 13 for better visual balance
- ๐ฑ Update example app defaults: battery state set to charging, percentage display toggled off
- ๐ง Fix formatting of Repository and Issue tracker links in README
- ๐ Improve example web page SEO: update meta description, keywords, title, and apple-mobile-web-app-title
- ๐ Add class-level documentation comment to
IosBatteryIndicator - ๐ฆ Include
screenshots/in published package files
1.0.1 #
- ๐ Improve code formatting in README and README_CN documentation examples
- Bump version to 1.0.1
1.0.0 #
- ๐ Initial stable release
- Core widget: Added
IosBatteryIndicatorwidget that faithfully replicates the native iOS battery indicator - Auto system battery monitoring: Reads battery level, charging state, and low-power mode from the device in real time
- Manual control mode: Supports manually specifying battery state via
batteryLevel,batteryState, andisInBatterySaveMode - iOS 27 style support: Supports the new borderless design introduced in iOS 27, with automatic iOS version detection
- Charging bolt overlay: Renders a bolt (โก) icon using the native Cupertino icon font when the battery is charging
- Cutout percentage effect: Percentage text is punched through the fill using a cutout effect for a polished look when discharging
- Low battery warning: Indicator turns red when the battery level drops below a configurable threshold (10โ30, defaults to 20)
- Battery save mode: Track turns yellow when low-power mode is active
- Light / Dark mode: Automatically adapts to ambient
Brightness, with an option to force a specific brightness via thebrightnessproperty - Smooth animations: Uses
AnimatedSwitcherfor display mode transitions andAnimatedThemefor theme transitions - Flexible sizing: Supports scaling via
heightorwidthproperties (mutually exclusive) - Display option controls: Supports
showBatteryPercentageto hide the percentage number andchargingWithBoltto hide the charging bolt icon - Custom theme: Added
BatteryIndicatorTheme, supports custom color schemes viaThemeData.extensions, with built-in.light()and.dark()factory constructors
