text static method

Widget text({
  1. required String label,
  2. Color? color,
  3. Color? lineColor,
  4. double lineWidth = 60.0,
  5. double spacing = 16.0,
  6. double thickness = 1.0,
  7. TextStyle? textStyle,
  8. double height = 40.0,
})

Implementation

static Widget text({
  required String label,
  Color? color,
  Color? lineColor,
  double lineWidth = 60.0,
  double spacing = 16.0,
  double thickness = 1.0,
  TextStyle? textStyle,
  double height = 40.0,
}) {
  final textColor = color ?? textStyle?.color ?? Colors.white;
  final effectiveLineColor = lineColor ?? textColor.withColorOpacity(0.5);

  return CustomPaint(
    size: Size(double.infinity, height.h),
    painter: CenterTextDivider(
      content: TextSpan(
        text: label,
        style: textStyle ??
            TextStyle(
                fontSize: 14, fontWeight: FontWeight.w400, color: textColor),
      ),
      lineColor: effectiveLineColor,
      thickness: thickness,
      spacing: spacing.w,
      lineWidth: lineWidth.w,
    ),
  );
}