isDone method
True when the simulation has effectively come to rest.
Implementation
@override
bool isDone(double t) {
const posThreshold = 0.001;
const velThreshold = 0.001;
return (position(t) - to).abs() < posThreshold &&
velocity(t).abs() < velThreshold;
}