expandFrom method
Begin expansion from origin → targetRect.
If origin is null, reuses the previously set origin.
Implementation
void expandFrom({
MorphOrigin? origin,
Rect? targetRect,
Duration? duration,
Curve? curve,
}) {
if (origin != null) _origin = origin;
if (targetRect != null) _targetRect = targetRect;
_isCollapsingIntent = false;
_setState(_state.copyWith(phase: MorphPhase.expanding, isDragging: false));
final from = _animationController.value;
final remaining = _remaining(from, 1.0, duration ?? _expandDuration);
_animationController.animateTo(
1.0,
duration: remaining,
curve: curve ?? _expandCurve,
);
}