DynamicBadge constructor

const DynamicBadge({
  1. required String label,
  2. required double childSize,
  3. Color? textColor,
  4. Color? backgroundColor,
  5. AlignmentGeometry? alignment,
  6. Widget? child,
  7. Key? key,
})

Implementation

const DynamicBadge({
  required String label,
  required double childSize,
  Color? textColor,
  Color? backgroundColor,
  AlignmentGeometry? alignment,
  Widget? child,
  super.key,
})  : _label = label,
      _textColor = textColor ?? Colors.white,
      _backgroundColor = backgroundColor ?? Colors.redAccent,
      _alignment = alignment ?? Alignment.center,
      _childSize = childSize,
      _child = child ?? const SizedBox(),
      assert(label.length <= 4, 'Label must be 4 characters or less');