easeInOut top-level property

Sampler easeInOut

Implementation

Sampler get easeInOut => (double startValue, double changeInTime,
        int currentTimeMs, int durationMs) {
      double t = currentTimeMs / (durationMs / 2);

      if (t < 1.0) return changeInTime / 2 * t * t + startValue;

      t--;

      return -changeInTime / 2 * (t * (t - 2) - 1) + startValue;
    };