computeState method

LiquidMorphState computeState({
  1. required double finalDx,
  2. required double finalDy,
  3. double horizontalOffset = 0.0,
  4. double verticalOffset = 0.0,
  5. double scaleDelta = 1.0,
  6. bool? adaptiveDamping,
  7. bool? isClosing,
})

Computes the current LiquidMorphState for the given layout geometry.

Implementation

LiquidMorphState computeState({
  required double finalDx,
  required double finalDy,
  double horizontalOffset = 0.0,
  double verticalOffset = 0.0,
  double scaleDelta = 1.0,
  bool? adaptiveDamping,
  bool? isClosing,
}) {
  final bool effectiveClosing = isClosing ?? _isClosing;
  final bool settled = !_animationController.isAnimating &&
      (effectiveClosing
          ? _animationController.value <= 0.001
          : _animationController.value >= 0.999);
  return LiquidMorphPhysics.compute(
    rawValue: _animationController.value,
    finalDx: finalDx,
    finalDy: finalDy,
    horizontalOffset: horizontalOffset,
    verticalOffset: verticalOffset,
    scaleDelta: scaleDelta,
    adaptiveDamping: adaptiveDamping,
    isClosing: effectiveClosing,
    elapsedSeconds: phaseElapsedSeconds,
    hasHandedOff: _hasHandedOff,
    isSettled: settled,
    disableAnimations: _disableAnimations,
    phaseStartTriggerWidth: _phaseStartTriggerWidth,
    closeStartProgress: _closeStartProgress,
    recoilHalfTravelPx: recoilHalfTravelPx,
    verticalOnlyRecoil: verticalOnlyRecoil,
  );
}