DynamicBadge.counter constructor
const
DynamicBadge.counter({})
Constructor to create a badge with a counter, The counter is limited to 999, if the counter is greater than 999 the label will be "999+"
Implementation
const DynamicBadge.counter({
required int count,
required double childSize,
Color? textColor,
Color? backgroundColor,
AlignmentGeometry? alignment,
Widget? child,
super.key,
}) : _label = count > 999 ? '999+' : '$count',
_backgroundColor = backgroundColor ?? Colors.redAccent,
_childSize = childSize,
_alignment = alignment ?? Alignment.center,
_textColor = textColor ?? Colors.white,
_child = child ?? const SizedBox();