validate method

void validate()

Implementation

void validate() {
  if (exitDuration < Duration.zero) {
    throw ArgumentError.value(
      exitDuration,
      'exitDuration',
      'Must be non-negative.',
    );
  }
  if (reboundDuration < Duration.zero) {
    throw ArgumentError.value(
      reboundDuration,
      'reboundDuration',
      'Must be non-negative.',
    );
  }
  if (!swipeThreshold.isFinite || swipeThreshold <= 0 || swipeThreshold > 1) {
    throw ArgumentError.value(
      swipeThreshold,
      'swipeThreshold',
      'Must be finite and greater than 0 up to 1.',
    );
  }
  if (!swipeVelocity.isFinite || swipeVelocity < 0) {
    throw ArgumentError.value(
      swipeVelocity,
      'swipeVelocity',
      'Must be finite and non-negative.',
    );
  }
}