badges 3.2.0
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: falsebeing ignored when a loop animation is active.didUpdateWidgetnow handlesshowBadgechanges before any loop-animation guards. - Issue #130 —
showBadge: falsenow hides the badge immediately._animationController.stop()and_appearanceController.stop()are called beforereverse()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.strokeAlignInsideinBoxDecoration, preventing background-colour bleed at antialiased edges. - Issue #115 (partial) — Key-based animation re-trigger: setting a
KeyonbadgeContentand changing it now restarts the animation for any widget type, not justTextandIcon.
New Features #
BadgeStyle.copyWith— Returns a copy of aBadgeStylewith 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/appearanceControllergetters — Public access to the internal animation controllers for advanced use cases (PR #128)._BadgeVisualprivate widget — Extracted badge visual from an inner closure into a properStatelessWidgetso 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 — Addedassertstatements documenting constructor invariants instead of silently force-unwrapping nullable fields.- Controller duration updates —
didUpdateWidgetnow updatesAnimationControllerdurations whenbadgeAnimationduration 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 (
600px→400px). - README: added
hide Badgeimport pattern (issue #123). - Bumped
flutter_lintsto^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
gradientparameter to theBadge - Add
BadgePosition.center()as a new factory constructor for theBadgePosition
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.
