build method Null safety

  1. @override
dynamic build(
  1. dynamic context
)

Implementation

@override
Widget build(BuildContext context) {
  return circular
      ? CircularPercentIndicator(
          radius: size,
          lineWidth: 5.0,
          percent: value <= 1.0 ? value : 1.0,
          center: Text(
            '${(value * 100).floor()}%',
            style: TextStyle(color: color),
          ),
          progressColor: color,
          backgroundColor: backgroundColor ?? color.withAlpha(50),
          circularStrokeCap: CircularStrokeCap.round,
        )
      : LinearPercentIndicator(
          width: width,
          percent: value <= 1.0 ? value : 1.0,
          progressColor: color,
          backgroundColor: backgroundColor ?? color.withAlpha(50),
        );
}