drawCloudyNight method

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

绘制多云的夜晚效果

Implementation

void drawCloudyNight(Canvas canvas, Size size) {
  ui.Image image = images[0];
  canvas.save();
  const identity = ColorFilter.matrix(<double>[
    0.32,
    0,
    0,
    0,
    0,
    0,
    0.39,
    0,
    0,
    0,
    0,
    0,
    0.52,
    0,
    0,
    0,
    0,
    0,
    0.9,
    0,
  ]);
  _paint.colorFilter = identity;
  final scale = 0.8 * widthRatio;
  ui.Offset offset1 = const ui.Offset(0, -200);
  ui.Offset offset2 = ui.Offset(-image.width / 2, -130);
  ui.Offset offset3 = const ui.Offset(100, 0);
  canvas.scale(scale, scale);
  canvas.drawImage(image, offset1, _paint);
  canvas.drawImage(image, offset2, _paint);
  canvas.drawImage(image, offset3, _paint);
  canvas.restore();
}