drawThunder method
这里主要负责绘制雷电
Implementation
void drawThunder(ThunderParams params, Canvas canvas, Size size) {
canvas.save();
var identity = ColorFilter.matrix(<double>[
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
params.alpha,
0,
]);
_paint.colorFilter = identity;
canvas.scale(params.widthRatio * 1.2);
canvas.drawImage(params.image, Offset(params.x, params.y), _paint);
canvas.restore();
}