draw method

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

Implementation

void draw(Canvas canvas, Size size) {
  canvas.save();
  if(_state._state == RenderState.drawing){
    for (var element in _state._particles) {
      element.advance(_state._controller!.value, _state.V, _state.END_VALUE);
      if(element.alpha > 0){
        canvas.drawImageRect(element.image,
            Rect.fromLTWH(0, 0, element.image.width.toDouble(), element.image.height.toDouble()),
            Rect.fromLTWH(element.cx - element.image.width / 4, element.cy - element.image.height / 4, element.image.width.toDouble()/2, element.image.height.toDouble()/2),
            _paint);
      }
    }
  }
  canvas.restore();
}