isDone method

  1. @override
bool isDone(
  1. double t
)
override

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;
}