Breaking Changes
- Migrated to
package:material_ui(#135, thanks @mayainle) — Material and Cupertino were decoupled from the Flutter SDK in Flutter 3.47 and now ship as standalone packages. This package now importspackage:material_ui/material_ui.dartinstead ofpackage:flutter/material.dart.- In apps that use
material_ui, badge content now gets the app's theme text style withoutMaterialUiCompatibilityBridge. Apps still onpackage:flutter/material.dartkeep working, but badge text uses the default Material text style until they migrate. This is a major version bump, as the Flutter team recommends for this migration. - To hide the ambiguous
Badge, useimport 'package:material_ui/material_ui.dart' hide Badge;instead of the Flutter Material equivalent.
- In apps that use
- Minimum SDK raised to Dart
3.13.0/ Flutter3.47.0, the floor required bymaterial_ui.
Bug Fixes
- Issue #133 — The
ignorePointerdocs said the opposite of what it does.truelets taps pass through the badge;false(default) lets the badge get taps. BadgeStyle.elevationworks again. It has drawn no shadow since 3.0.3. The default is now0, so badges that don't set it look the same as before.BadgePosition.center()withonTapno longer moves the badge to the top-left corner.BadgePosition.centerStart()/centerEnd()are now vertically centered, as documented.- Right-to-left layouts with
onTapno longer shift the badge. The tap padding is now directional. - Hidden badges (
showBadge: false) no longer catch taps or callonTap; taps reach the widget below. - Twitter / Instagram shapes no longer crash with gradients of 3+ colors. Gradient
stops,tileMode, sweep angles and directional alignments are now used. - Turning
toAnimateon at runtime no longer leaves the badge invisible. - Fixed a listener leak: every rebuild added a listener to the appearance controller.
- Removed a no-op
ConstrainedBox. The 3.2.0 "minimum-square sizing" note was wrong: badge sizing did not change in 3.2.0 and does not change now.
Maintenance
- Replaced
SizeTransition.axisAlignment, deprecated after Flutter v3.41, withalignment.BadgeAnimation.sizeTransitionAxisAlignmentis unchanged and still takes adouble. - CI: removed the broken "Code Quality" workflow, set up pub.dev automated publishing in the publish workflow, updated actions, added a weekly run on Flutter beta.
- Example app: regenerated Android / iOS / Windows projects so it builds again, and fixed the test screen overflowing on phone widths.
- Smaller pub.dev archive (
.pubignore). - README: fixed build and downloads badges, documented
onTappadding andignorePointer.
Install: flutter pub add badges (needs Flutter 3.47+ / Dart 3.13+). Apps on older Flutter keep getting 3.2.0.
Full changelog: v3.2.0...v4.0.0