updateFrame method
Implementation
void updateFrame(double viewWidth, double viewHeight){
if(_finished){
return;
}
// go left
_x -= _factor;
// go down
_y += _factor;
_trailPaint.shader = ui.Gradient.linear(
Offset(_x, _y),
Offset(_x + _trailLength, _y - _trailLength),
<Color>[color, color.withOpacity(0.0)]
);
if (_x < (viewWidth * -0.5)) {
listener.onMeteoriteComplete();
_finished = true;
}
}