UnreadBadge class

A widget that shows a badge to display how many unread notifications there are.

See also:

Inheritance
Available Extensions

Constructors

UnreadBadge({required int unread, Key? key, String? semanticsLabel, int maximumDigits = 3, Color? foregroundColor, Color? backgroundColor, double minWidth = 16, double minHeight = 16, Color? badgeContainerColor})
Displays the unread parameter in a red circle.
const

Properties

backgroundColor Color?
Background color for the widget Defaults to theme's error color.
final
badgeContainerColor Color?
The color of the surface where this badge is being drawn on. Typically, this will be the surface color. However, in cases where this widget is used in a context with a different surface color, such as in an AppBar, this value should be set to the AppBar's background color.
final
foregroundColor Color?
Foreground color for the text. Defaults to theme's onError color.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maximumDigits int
How many digits long the unread amount can be. For example, if set to 3, any number over 999 will be shown as 999+ or +999 depending on the locale used and the text direction.
final
minHeight double
Min height of the unread bubble. Defaults to 16.
final
minWidth double
Min width of the unread bubble. Defaults to 16.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticsLabel String?
Optional text to replace the default Semantics behavior of reading the number in this badge.
final
unread int
The number to show in the badge.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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.
override
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}) 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