IconBadgeButton class
Round icon button (e.g. settings/shop) that can carry a small badge in
its corner — a plain notification dot (showBadge), or a count
(badgeCount) when a number is needed.
The badge pops (scale bounce) the moment it newly appears or its count
changes — same "something just happened" moment StreakCounter/
ProgressBarStars already animate — but never on initial mount even if
the badge is already showing.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- IconBadgeButton
Constructors
- IconBadgeButton({Key? key, required IconData icon, required VoidCallback? onTap, bool showBadge = false, int? badgeCount, Color? color, Color? badgeColor, double size = 44, String? semanticLabel})
-
const
Properties
- badgeColor → Color?
-
Badge color. Default: red.
final
- badgeCount → int?
-
When > 0, shows a numeric badge instead of the plain dot (badgeCount >
99 -> "99+").
final
- color → Color?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onTap → VoidCallback?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Screen-reader label. Falls back to icon's debug string (not
human-readable) when omitted — always pass this in real usage.
final
- showBadge → bool
-
Shows a plain (numberless) badge dot when true.
final
- size → double
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< IconBadgeButton> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited