resetWith method

  1. @override
void resetWith({
  1. required TouchRippleBehavior behavior,
})
override

Resets the current animation setting values of this instance with a value that corresponds to the given behavior.

Implementation

@override
void resetWith({
  required TouchRippleBehavior behavior,
}) {
  _behavior = behavior;
  _spreadAnimation.duration = _behavior.spreadDuration;
  _fadeAnimation.duration = _behavior.fadeInDuration;
  _fadeAnimation.reverseDuration = _behavior.fadeOutDuration;

  assert(behavior.fadeInCurve != null, 'Fade in curve of touch ripple behavior was not initialized.');
  assert(behavior.fadeOutCurve != null, 'Fade out curve of touch ripple behavior was not initialized.');
  _fadeCurved.curve = _behavior.fadeInCurve ?? Curves.linear;
  _fadeCurved.reverseCurve = _behavior.fadeOutCurve;
}