move method

void move(
  1. RainSnowParams params
)

Implementation

void move(RainSnowParams params) {
  params.y = params.y + params.speed;
  if (WeatherUtil.isSnow(_state.widget.weatherType)) {
    double offsetX = sin(params.y / (300 + 50 * params.alpha)) *
        (1 + 0.5 * params.alpha) *
        params.widthRatio;
    params.x += offsetX;
  }
  if (params.y > params.height / params.scale) {
    params.y = -params.height * params.scale;
    if (WeatherUtil.isRainy(_state.widget.weatherType) &&
        _state._images.isNotEmpty) {
      params.y = -_state._images[0].height.toDouble();
    }
    params.reset();
  }
}