I am reading some code example online and see this:
class _CirclePainter extends BoxPainter {
final Paint _paint;
final double radius;
_CirclePainter(Color color, this.radius)
: _paint = Paint()
..color = color
..isAntiAlias = true;
@override
void paint(Canvas canvas, Offset offset, ImageConfiguration cfg) {
final Offset circleOffset =
offset + Offset(cfg.size.width / 2, cfg.size.height - radius - 5);
canvas.drawCircle(circleOffset, radius, _paint);
}
}
Can someone please explain what are the semicolon and the double dots? I only know "(condition) ? (do this) : (do that)".
_CirclePainter(Color color, this.radius)
: _paint = Paint()
..color = color
..isAntiAlias = true;
Thanks.
EDIT: I meant colon, not semicolon.