build method
Override this method to build widgets that depend on the state of the listenable (e.g., the current value of the animation).
Implementation
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Container(
child: CustomPaint(
size: Size(width ?? constraints.maxWidth, height),
painter: StrengthBarBackground(
backgroundColor: backgroundColor, backgroundRadius: radius),
foregroundPainter: StrengthBar(
barColor: barColor,
barRadius: radius,
percent: _percent.value)));
});
}