Badge constructor

Badge({
  1. Key? key,
  2. String? text,
  3. Color? badgeColor,
  4. Color? textColor,
  5. double? fontSize,
  6. EdgeInsets padding = const EdgeInsets.only(top: 2, right: 4, bottom: 2, left: 4),
  7. Radius radius = const Radius.circular(8),
  8. TextStyle? textStyle,
  9. InlineSpan? textSpan,
  10. TextStyle? style,
  11. StrutStyle? strutStyle,
  12. TextAlign? textAlign,
  13. TextDirection? textDirection,
  14. Locale? locale,
  15. bool? softWrap,
  16. TextOverflow? overflow,
  17. double? textScaleFactor,
  18. int? maxLines,
  19. String? semanticsLabel,
  20. TextWidthBasis? textWidthBasis,
  21. Text? textView,
})

Implementation

Badge({
  super.key,
  String? text,
  Color? badgeColor,
  Color? textColor,
  double? fontSize,
  this.padding = const EdgeInsets.only(top: 2, right: 4, bottom: 2, left: 4),
  this.radius = const Radius.circular(8),
  TextStyle? textStyle,
  this.textSpan,
  this.style,
  this.strutStyle,
  this.textAlign,
  this.textDirection,
  this.locale,
  this.softWrap,
  this.overflow,
  this.textScaleFactor,
  this.maxLines,
  this.semanticsLabel,
  this.textWidthBasis,
  this.textView,
})  : text = text ?? '',
      textStyle = textStyle ??
          TextStyle(
              color: textColor ?? Colors.white, fontSize: fontSize ?? 10),
      badgeColor = badgeColor ?? Colors.blue;