OverlayMorphController class
Central controller for the overlay carousel morph transition.
Uses two AnimationControllers:
_overlayControllerdrives appear/disappear (origin rect → card center)._expandControllerdrives expand/collapse (card center → fullscreen).
Horizontal carousel index changes are gesture-driven with deterministic snap resolution via CarouselSnapResolver.
Important: The TickerProvider passed to vsync must support
multiple tickers — use TickerProviderStateMixin, not
SingleTickerProviderStateMixin.
- Inheritance
-
- Object
- ChangeNotifier
- OverlayMorphController
Constructors
- OverlayMorphController({required TickerProvider vsync, Duration appearDuration = const Duration(milliseconds: 220), Duration disappearDuration = const Duration(milliseconds: 150), Duration expandDuration = const Duration(milliseconds: 260), Duration collapseDuration = const Duration(milliseconds: 200), Curve appearCurve = Curves.easeOutBack, Curve disappearCurve = Curves.easeOutQuad, Curve expandCurve = Curves.fastOutSlowIn, Curve collapseCurve = Curves.easeOutQuad, double dismissThreshold = 0.35, double expandThreshold = 0.35, double flickVelocityThreshold = 800.0, double cardWidthFraction = 0.85, double cardHeightFraction = 0.72})
Properties
- appearCurve → Curve
-
final
- appearDuration → Duration
-
final
- cardHeightFraction → double
-
Fraction of screen height for the centered card.
final
- cardRect → Rect?
-
no setter
- cardWidthFraction → double
-
Fraction of screen width for the centered card.
final
- collapseCurve → Curve
-
final
- collapseDuration → Duration
-
final
- currentIndex → int
-
no setter
- currentRect → Rect?
-
no setter
- disappearCurve → Curve
-
final
- disappearDuration → Duration
-
final
- dismissThreshold → double
-
final
-
expandAnimation
→ Animation<
double> -
no setter
- expandCurve → Curve
-
final
- expandDuration → Duration
-
final
- expandProgress → double
-
no setter
- expandThreshold → double
-
final
- flickVelocityThreshold → double
-
final
- fullscreenRect → Rect?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hasSelection → bool
-
no setter
- horizontalDragOffset → double
-
no setter
- isAnimating → bool
-
no setter
- isDragging → bool
-
no setter
- isIdle → bool
-
no setter
- itemCount → int
-
no setter
- originRect → Rect?
-
no setter
-
overlayAnimation
→ Animation<
double> -
no setter
- overlayProgress → double
-
no setter
- phase → OverlayPhase
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedItem → Object?
-
no setter
- state → OverlayMorphState
-
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
collapse(
) → void -
dismiss(
) → void -
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
expand(
) → void -
handleBackButton(
) → bool -
Handle system back button. Returns
trueif the back was consumed. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onHorizontalDragEnd(
double velocity, double cardWidth) → void -
onHorizontalDragUpdate(
double delta) → void -
onVerticalDragEnd(
double velocity, double availableHeight) → void -
onVerticalDragStart(
) → void -
onVerticalDragUpdate(
double delta, double availableHeight) → void -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
selectItem(
Object item, {required int itemIndex, required Rect originRect, required Size screenSize}) → void - Select an item and begin the appear animation.
-
setIndex(
int index) → void -
toString(
) → String -
A string representation of this object.
inherited
-
updateItemCount(
int count) → void -
updateOriginRect(
Rect rect) → void -
updateScreenSize(
Size size) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited