badges 3.2.0 copy "badges: ^3.2.0" to clipboard
badges: ^3.2.0 copied to clipboard

A package for creating badges. Badges can be used for an additional marker for any widget, e.g. show a number of items in a shopping cart.

3.2.0 [April 9, 2026] #

Bug Fixes #

  • Issue #114 — Fixed showBadge: false being ignored when a loop animation is active. didUpdateWidget now handles showBadge changes before any loop-animation guards.
  • Issue #130showBadge: false now hides the badge immediately. _animationController.stop() and _appearanceController.stop() are called before reverse() so the badge does not wait for the animation to play through.
  • Issue #98 — Fixed border anti-aliasing artifact. Border is now drawn entirely inside the circle via strokeAlign: BorderSide.strokeAlignInside in BoxDecoration, preventing background-colour bleed at antialiased edges.
  • Issue #115 (partial) — Key-based animation re-trigger: setting a Key on badgeContent and changing it now restarts the animation for any widget type, not just Text and Icon.

New Features #

  • BadgeStyle.copyWith — Returns a copy of a BadgeStyle with overridden fields.
  • BadgePosition.centerStart — New named constructor: badge vertically centered on the start (left) side.
  • BadgePosition.centerEnd — New named constructor: badge vertically centered on the end (right) side.
  • BadgeState.animationController / appearanceController getters — Public access to the internal animation controllers for advanced use cases (PR #128).
  • _BadgeVisual private widget — Extracted badge visual from an inner closure into a proper StatelessWidget so Flutter's element tree can cache it and avoid rebuilding the full subtree on every opacity tick (PR #120).
  • Minimum-square badge sizing — Single-character text and small-icon badges now maintain correct circular/square proportions (PR #111).
  • BadgeGradient.gradient() asserts — Added assert statements documenting constructor invariants instead of silently force-unwrapping nullable fields.
  • Controller duration updatesdidUpdateWidget now updates AnimationController durations when badgeAnimation duration properties change.

Example App & Docs #

  • Fixed all lint warnings in example/ (use_super_parameters, prefer_final_fields, curly_braces_in_flow_control_structures, avoid_print, deprecated_member_use).
  • README: fixed showcase GIF height (600px400px).
  • README: added hide Badge import pattern (issue #123).
  • Bumped flutter_lints to ^6.0.0.

3.1.2 [August 28, 2023] #

  • Update Dart SDK version. Update readme.

3.1.1 [April 14, 2023] #

  • Return to 3.0.3 version functionality due to bug

3.1.0 [April 11, 2023] #

  • Add BadgeShape.triangle
  • Fix custom shapes deformation depending on the badge content

3.0.3 [March 24, 2023] #

  • Fix transparent color for the badge

3.0.2 [Jan 25, 2023] #

  • Due to Badge widget introduction in Material library, the package is refatored to avoid ambiguous imports. badges.Badge used everywhere.
  • Readme updated

3.0.0-beta.1 [Dec 25, 2022] #

  • Add onTap for Badge
  • Add Twitter and Instagram shapes
  • Add size, rotation and color change animation for Badge
  • Add loop animation
  • Add border gradient
  • Add more customization for animation and style
  • Breaking changes! Please check the readme for simple migration guide

2.0.3 [Jun 2, 2022] #

  • Fix border radius of the badge, when using it with gradient

2.0.2 [Jul 28, 2021] #

  • Add gradient parameter to the Badge
  • Add BadgePosition.center() as a new factory constructor for the BadgePosition

2.0.1 [May 13, 2021] #

  • Add parameter to edit fit parameter Stack widget

2.0.0 [April 20, 2021] #

  • Stable null safety

2.0.0-nullsafety.1 [March 13, 2021] #

  • Null safety, finally! Prerelease

1.2.0 [March 4, 2021] #

  • Breaking change! Deprecated parameter 'Overflow' replaced with 'Clip' for Stack widget.
  • Documentation implementation

1.1.6 [December 8, 2020] #

  • Fix error parameter with the name 'clipBehavior'

1.1.5 [December 7, 2020] #

  • Add borderSide parameter to customize the badge border
  • Fix issue where null border radius was provided

1.1.4 [October 23, 2020] #

  • Migrate Android embedding v2, fix overflow issue
  • Ignore pointer option for Badge
  • Custom border radius for Badge

1.1.3 [September 22, 2020] #

  • Fix for deprecated overflow parameter on Stack widget

1.1.2 [August 27, 2020] #

  • RTL devices support

1.1.1 [February 27, 2020] #

  • Add alignment parameter to define position of the whole widget

1.1.0 [July 2, 2019] #

  • Added showBadge parameter to hide or show badge with animation

1.0.3 [June 5, 2019] #

  • Fixed a bug when all the badges on the screen are animated if one of them is updated. Fixed only for badges that have Text or Icon in badge content.

1.0.2 [June 5, 2019] #

  • Updated versions in readme.

1.0.1 [June 4, 2019] #

  • Updated readme images and lib description.

1.0.0 [June 4, 2019] #

  • Badge class for creating badges for every widget.
3.74k
likes
160
points
300k
downloads
screenshot

Documentation

API reference

Publisher

verified publisheryako.io

Weekly Downloads

A package for creating badges. Badges can be used for an additional marker for any widget, e.g. show a number of items in a shopping cart.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on badges