copyWith method

OverlayMorphState copyWith({
  1. double? overlayProgress,
  2. double? expandProgress,
  3. OverlayPhase? phase,
  4. int? currentIndex,
  5. int? itemCount,
  6. Object? selectedItem,
  7. bool clearSelection = false,
  8. Rect? originRect,
  9. bool clearOriginRect = false,
  10. Rect? cardRect,
  11. bool clearCardRect = false,
  12. Rect? fullscreenRect,
  13. bool? isDragging,
  14. bool? isAnimating,
  15. double? velocity,
  16. double? horizontalDragOffset,
})

Implementation

OverlayMorphState copyWith({
  double? overlayProgress,
  double? expandProgress,
  OverlayPhase? phase,
  int? currentIndex,
  int? itemCount,
  Object? selectedItem,
  bool clearSelection = false,
  Rect? originRect,
  bool clearOriginRect = false,
  Rect? cardRect,
  bool clearCardRect = false,
  Rect? fullscreenRect,
  bool? isDragging,
  bool? isAnimating,
  double? velocity,
  double? horizontalDragOffset,
}) {
  return OverlayMorphState(
    overlayProgress: overlayProgress ?? this.overlayProgress,
    expandProgress: expandProgress ?? this.expandProgress,
    phase: phase ?? this.phase,
    currentIndex: currentIndex ?? this.currentIndex,
    itemCount: itemCount ?? this.itemCount,
    selectedItem:
        clearSelection ? null : (selectedItem ?? this.selectedItem),
    originRect:
        clearOriginRect ? null : (originRect ?? this.originRect),
    cardRect: clearCardRect ? null : (cardRect ?? this.cardRect),
    fullscreenRect: fullscreenRect ?? this.fullscreenRect,
    isDragging: isDragging ?? this.isDragging,
    isAnimating: isAnimating ?? this.isAnimating,
    velocity: velocity ?? this.velocity,
    horizontalDragOffset:
        horizontalDragOffset ?? this.horizontalDragOffset,
  );
}