ios_battery_indicator 1.7.0 copy "ios_battery_indicator: ^1.7.0" to clipboard
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 Pro font (./fonts/SF-Pro.ttf) so the indicator uses it natively on every platform.
  • ๐ŸŽจ Use SF Pro in the indicator's DefaultTextStyle.
  • ๐ŸŽจ 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 DefaultTextStyle for correct font and glyph metrics.

1.6.1 #

  • ๐ŸŽจ _buildBolt now inherits the parent DefaultTextStyle for correct glyph metrics.
  • ๐ŸŽจ Tweaked the bolt icon scaling for better visual alignment.

1.6.0 #

  • ๐ŸŽจ BatteryIndicatorTheme: add chargingTrackColor, criticallyLowTrackColor, and saveModeTrackColor (optional, with Cupertino defaults) to customize the track color for charging, critically-low, and battery-save-mode states.
  • ๐Ÿ”ง _trackColor now reads these states' colors from BatteryIndicatorTheme instead of hardcoded CupertinoColors.

1.5.1 #

  • ๐ŸŽจ At 100%, drop tabularFigures from fontFeatures while keeping other features.
  • ๐ŸŽจ Simplify percentage text font weight.
  • ๐Ÿ“ Document fontFeatures and its 100% behavior.

1.5.0 #

  • โœจ Add configurable fontFeatures for the battery percentage text (default const [FontFeature.tabularFigures()]); only effective when showBatteryPercentage is true.

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 14 instead of 13 when the percentage is shown, for better text proportion
  • ๐ŸŽจ Tighten corner radii for the classic style (outer 3.2 / inner 1.6 vs 4 / 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 w800 font 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 .38 light-theme bgColor alpha for non-iOS 27 outline (.28 for iOS 27 fill)
  • ๐ŸŽจ Add .5 inset padding to the classic (non-iOS 27) battery style

1.4.1 #

  • ๐Ÿ› Fix percentage text display on macOS

1.4.0 #

  • โœจ Add configurable batteryLevelPollInterval for the battery-level poll in system mode (default 30s)

1.3.0 #

  • โœจ Add monitorBatterySaveMode to poll Low Power Mode at runtime when isInBatterySaveMode is null, with configurable saveModePollInterval (default 30s)

1.2.7 #

  • ๐ŸŽจ Shrink fill bar height at low battery (< 20%) in classic style to match corner radius
  • ๐Ÿ› Fix AnimatedSwitcher key for classic style so charging/bolt transitions animate
  • โœจ Use w800 font weight at 100%, w700 otherwise, 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 platforms declaration to pubspec.yaml for all supported platforms

1.2.2 #

  • ๐ŸŽจ Refine battery indicator layout and fill animation for smoother, more polished appearance
  • ๐Ÿ› Fix chargingWithBolt display 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.scale wrappers from percentage text and cutout mask, use Padding inset instead for more predictable layout

1.2.0 #

  • ๐Ÿ”Š New playChargingSound parameter โ€” 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 onBatteryLevelChanged and onBatteryStateChanged to receive real-time system battery updates in auto mode
  • ๐Ÿ› Fix percentage text vertical misalignment by applying TextHeightBehavior to suppress extra ascent/descent

1.0.3 #

  • ๐ŸŽฌ Added animationDuration parameter to control all indicator animations, including fill progress, color changes, bolt icon, and crossfade transitions
  • ๐ŸŽจ Fix cutout percentage text overflow by wrapping maskChild with FittedBox for proper scaling

1.0.2 #

  • ๐ŸŽจ Adjust text rendering: wrap battery indicator in DefaultTextStyle with height: 1 and fontWeight: .w500 for 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 IosBatteryIndicator widget 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, and isInBatterySaveMode
  • 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 the brightness property
  • Smooth animations: Uses AnimatedSwitcher for display mode transitions and AnimatedTheme for theme transitions
  • Flexible sizing: Supports scaling via height or width properties (mutually exclusive)
  • Display option controls: Supports showBatteryPercentage to hide the percentage number and chargingWithBolt to hide the charging bolt icon
  • Custom theme: Added BatteryIndicatorTheme, supports custom color schemes via ThemeData.extensions, with built-in .light() and .dark() factory constructors
1
likes
150
points
1.06k
downloads
screenshot

Documentation

API reference

Publisher

verified publishernoob-coder.com

Weekly Downloads

A Flutter widget that replicates the native iOS battery indicator, including support for iOS 27 style and automatic system battery monitoring.

Homepage
Repository (GitHub)
View/report issues

Topics

#battery-indicator #cupertino #widget #ui #components

License

MIT (license)

Dependencies

battery_plus, cutout, device_info_plus, flutter, ios_system_sound, version

More

Packages that depend on ios_battery_indicator