Fluent2Badge class

Fluent 2's CounterBadge: a count on a Fluent2LabelBadge (filled brand and circular by default, Fluent2BadgeAppearance.ghost for the ink alone), shown as [overflowCount]+ past overflowCount (99), hidden at zero unless showZero, or a 6 dot that says only that something is new (Fluent2Badge.dot). Rides child's top end corner, as Material's Badge rides an icon, or stands alone at a row's end. Read as label, else its count ("99+").

Fluent2Badge(3, color: Fluent2BadgeCountColor.danger, label: '3 unread messages', child: Icon(Fluent2Icons.mail))
Inheritance

Constructors

Fluent2Badge(int count, {Key? key, String? label, Widget? child, int overflowCount = 99, bool showZero = false, Fluent2BadgeCountColor color = Fluent2BadgeCountColor.brand, Fluent2BadgeAppearance appearance = Fluent2BadgeAppearance.filled, Fluent2BadgeSize size = Fluent2BadgeSize.medium, Fluent2BadgeShape shape = Fluent2BadgeShape.circular})
count as words.
const
Fluent2Badge.dot({Key? key, String? label, Widget? child, Fluent2BadgeCountColor color = Fluent2BadgeCountColor.brand, Fluent2BadgeAppearance appearance = Fluent2BadgeAppearance.filled, Fluent2BadgeShape shape = Fluent2BadgeShape.circular})
The 6 dot that says only that something is new ("New").
const

Properties

appearance → Fluent2BadgeAppearance
Fluent's two for a counter: Fluent2BadgeAppearance.filled or Fluent2BadgeAppearance.ghost.
final
child → Widget?
What it rides; null draws the badge alone.
final
color → Fluent2BadgeCountColor
Fluent's color.
final
count → int
What it counts.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label → String?
What a screen reader says ("3 unread messages"); null says the count.
final
overflowCount → int
The largest count shown before it reads N+.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shape → Fluent2BadgeShape
Fluent's shape: its corners.
final
showZero → bool
Draw a zero count instead of nothing.
final
size → Fluent2BadgeSize
Fluent's size: how large it is drawn.
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, 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

Static Methods

textOf(int count, int overflow) → String
The words a count shows past overflow.