DynamicBadge constructor

const DynamicBadge({
  1. required int count,
  2. required Widget child,
  3. Color textColor = Colors.white,
  4. Color backgroundColor = Colors.redAccent,
  5. Key? key,
})

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({
  required int count,
  required this.child,
  this.textColor = Colors.white,
  this.backgroundColor = Colors.redAccent,
  super.key,
}): label = count > 999 ? '999+' : '$count', type = BadgeType.large;