drawFoggy method

void drawFoggy(
  1. Canvas canvas,
  2. Size size
)

绘制雾

Implementation

void drawFoggy(Canvas canvas, Size size) {
  ui.Image image = images[0];
  canvas.save();
  const identity = ColorFilter.matrix(<double>[
    0.75,
    0,
    0,
    0,
    0,
    0,
    0.77,
    0,
    0,
    0,
    0,
    0,
    0.82,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
  ]);
  _paint.colorFilter = identity;
  final scale = 2.0 * widthRatio;
  ui.Offset offset1 = ui.Offset(-image.width.toDouble() * 0.5, -200);
  canvas.scale(scale, scale);
  canvas.drawImage(image, offset1, _paint);
  canvas.restore();
}