MotionBadgeWidget constructor

const MotionBadgeWidget({
  1. Key? key,
  2. bool? isIndicator,
  3. String? text,
  4. Color? textColor,
  5. double? size,
  6. Color? color,
  7. bool? disabled,
  8. bool? show,
})

Creates a MotionBadgeWidget.

text is the badge text (at most 3 characters). When isIndicator is true, a plain dot is rendered instead of a text badge. color and textColor control the badge and text colors, size controls the badge size, disabled dims the badge, and show toggles visibility.

Implementation

const MotionBadgeWidget({
  Key? key,
  bool? isIndicator,
  this.text,
  Color? textColor,
  double? size,
  Color? color,
  bool? disabled,
  bool? show,
})  : _isIndicator = isIndicator ?? false,
      _color = color ?? Colors.red,
      _textColor = textColor ?? Colors.white,
      _size = size ?? (isIndicator == true ? 5 : 18),
      _disabled = disabled ?? false,
      _show = show ?? true,
      assert(text != null ? text.length <= 3 : true),
      super(key: key);