morphing_sheet 0.6.2
morphing_sheet: ^0.6.2 copied to clipboard
A production-ready Flutter package for contextual morphing containers — supporting both card carousel snapping and Instamart-style overlay card transitions.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.6.2 - 2026-03-05 #
Added #
- MorphingListBuilder (High-Level API) — A new "all-in-one" builder that abstracts away controller management, overlay wiring, and gesture handling:
MorphingListBuilder<T>provides a declarative API similar toListView.builder.- Automatically manages
OverlayMorphControllerlifecycle. - Supports
gridmode with responsive column logic (Phone: 2, Tablet: 3, Desktop: 4). - Injects
MorphingSourceandMorphShared(hero tags) automatically.
- Premium Spatial UI/UX — Advanced interactions for a flagship-grade feel:
- Curved Thumbnail Navigation: A center-locked, scrollable thumbnail bar in the overlay that curves upward at the center using an exponential mathematical curve.
- 3D Perspective Tilt: Cards subtly tilt in 3D space during drag gestures.
- Premium Lift Animations: Uses
Curves.easeOutBackand 3D scaling (0.96 → 1.0) for a "popping" entrance. - Parallax Content: Content inside cards shifts slightly while swiping, creating a 3D depth illusion.
- New Atomic Components:
MorphListViewandMorphGridViewfor standard layout rendering.MorphPreviewCarouselfor horizontal card swiping logic.
Changed #
- Overlay UX: Replaced simple dot indicators with the premium thumbnail bar.
- Performance: Added
RepaintBoundaryisolation for the overlay card and thumbnail layers to ensure 60/120 FPS.
Migration from 0.5.x #
- Developers can now replace manual
MorphingSource+MorphingOverlaycode with a singleMorphingListBuilderfor a ~75% reduction in boilerplate.
0.5.0 - 2026-03-03 #
Changed (Breaking) #
- Overlay Rect Mode upgraded to Overlay Carousel Mode — the overlay now integrates a full horizontal card carousel between appear and fullscreen phases:
OverlayMorphControllernow uses twoAnimationControllers: one for appear/disappear (origin → card center), one for expand/collapse (card → fullscreen). RequiresTickerProviderStateMixin(notSingleTickerProviderStateMixin).OverlayMorphStatereplaces singleprogressfield withoverlayProgress+expandProgress, addscurrentIndex,itemCount,horizontalDragOffset, andcardRect.OverlayPhaseexpanded:idle→appearing→cardMode→expanding→fullscreen→collapsing→cardMode→disappearing→idle.MorphingOverlay<T>now requiresitems: List<T>to render the horizontal carousel. Renders active + adjacent cards with scale, opacity, and direction-locked horizontal swiping.MorphingSource<T>now requiresitemIndex: intfor carousel starting position.OverlayGestureLayerupgraded to direction-locking pan gestures (horizontal → carousel, vertical up → expand, vertical down → dismiss).OverlayMorphController.selectItemnow takesitemIndexparameter.- New controller methods:
setIndex(int),collapse(),onHorizontalDragUpdate(),onHorizontalDragEnd(). - New controller getters:
overlayProgress,expandProgress,currentIndex,itemCount,cardRect,horizontalDragOffset.
RectMorphTweenextended with overlay carousel helpers:computeCardRect,overlayScrimOpacity,overlayBlur,overlayBackgroundScale,adjacentCardOpacity,adjacentCardScale.
Migration from 0.4.x #
- Replace
OverlayMorphState.progresswithoverlayProgress+expandProgress. - Replace
OverlayPhase.expanding/collapsingwith new multi-phase state machine (add handling forappearing,cardMode,disappearing). - Add
items: [...]parameter toMorphingOverlay. - Add
itemIndex: indexparameter toMorphingSource. - Change
SingleTickerProviderStateMixintoTickerProviderStateMixinin host widget.
Unchanged #
- All v0.3.0 card carousel APIs remain fully intact.
package:morphing_sheet/morphing_card_carousel.dartbarrel export unchanged.
0.4.0 - 2026-03-03 #
Added #
- Overlay Rect Mode — Instamart-style contextual morph where a tapped grid/list item expands from its exact on-screen position into a floating container, then into fullscreen detail:
OverlayMorphController— singleAnimationControllerdriving rect-based morph progress withselectItem(item, originRect:),dismiss(),expand(), and gesture callbacksOverlayMorphState— immutable state snapshot:State = f(progress, selectedItem, originRect)with computedcurrentRectviaRect.lerpOverlayPhasestate machine:idle→expanding→fullscreen→collapsing→idleMorphingOverlay<T>— main overlay container widget with scrim, blur, andPositioned.fromRectcard renderingMorphingSource<T>— tap-capture wrapper that readsRenderBoxglobal position and triggersselectItemOverlayGestureLayer— vertical drag handling for expand/collapse/flick-dismissRectMorphTween— pure-function interpolation helpers for rect, position, size, radius, elevation (peak-and-drop), scrim opacity, blur, background scale, and content crossfade
- New barrel export:
package:morphing_sheet/morphing_overlay.dart - Overlay rect mode example app with product grid, contextual morph, and fullscreen detail
- Demo hub with navigation to both Card Carousel and Overlay Rect modes
Unchanged #
- All v0.3.0 card carousel APIs remain fully intact (
MorphingCardCarousel<T>,CardCarouselController,CardMorphTween, etc.) package:morphing_sheet/morphing_card_carousel.dartbarrel export unchanged
0.3.0 - 2026-03-03 #
Added #
- Morphing Card Carousel — a centered, card-based, swipe-driven fullscreen-morph interaction system:
MorphingCardCarousel<T>main widget with generic item supportCardCarouselController— singleAnimationControllerdriving vertical morph, radius, elevation, background blur, and thumbnail opacityCardMorphTween— pure-function interpolation helpers (morphHeight,morphWidth,morphRadius,morphElevation,morphBackgroundOpacity,morphBackgroundBlur,thumbnailOpacity)CarouselScrollPhysics— custom velocity-aware snap physics (no defaultPageViewphysics)CarouselSnapResolver— deterministic horizontal index resolution from velocity + displacementCardGestureLayer— direction-locking gesture disambiguation (horizontal vs vertical)CardStackLayer— positioned card rendering with active/adjacent transformsThumbnailSelectorBar— horizontally scrollable circular thumbnail strip with auto-scrollBackgroundLayer— scale, blur, and barrier driven by progressCardPhasestate machine:collapsedCard→transitioningToFull→fullscreen→transitioningToCardCardCarouselState— immutable state snapshot:State = f(verticalProgress, currentIndex)CardItem<T>— stable-identity data wrapper
- Card carousel example app with Swiggy Instamart-style product cards, detail morph, and persistent cart bar
Changed #
- Complete architectural rebuild from bottom-sheet paradigm to centered card carousel paradigm
- Package now exports via
morphing_card_carousel.dartbarrel file - No implicit animation widgets — all visuals driven by raw
Opacity,Transform,SizedBox - Horizontal and vertical gestures are direction-locked after 16px threshold
- Index changes only when
verticalProgress == 0.0
Removed #
- All v0.1.x/v0.2.x sheet-based APIs (
MorphingSheet,SheetController,SheetConfig,SheetScaffold, etc.) DraggableScrollableSheet-based patterns- Default
PageViewsnapping
Migration from 0.2.x #
This is a breaking change. Replace MorphingSheet / MorphingSheet.listDriven<T>() with MorphingCardCarousel<T>().
Replace SheetController with CardCarouselController.
0.2.1 #
- Added pub.dev badges to README
- Documentation improvements
0.2.0 - 2026-03-03 #
Added #
- List-driven mode via
MorphingSheet.listDriven<T>()— context-aware, item-selection-based sheet with three content layers:DynamicListLayer— lazyListView.builderfor collapsed state (supports 200+ items at 60fps)PreviewLayer— selected item preview at half-expanded stateDetailLayer— fullscreen scrollable detail at expanded state with scroll-to-drag handoff
SheetItem<T>model — lightweight value object wrapping user data for list-driven mode.ItemMorphTween— pure-function interpolation helpers for item-to-sheet morph transitions (morphRect, morphRadius, morphElevation, listOpacity, previewOpacity, detailOpacity).SheetControlleritem selection API:selectItem(Object item)— select item + animate to half-expanded previewclearSelection()— deferred selection clearing (null-out after collapse animation completes)animateToSnap(SnapPoint)— named snap animationanimateToItemDetail(Object item)— select + animate directly to expanded detailselectedItem/hasSelectiongetters
SheetState.selectedItemandSheetState.hasSelectionfor list-driven mode context.SheetScaffold.contentLayerBuilder— custom content composition hook for list-driven mode.- Magnetic snap attraction in
DefaultSheetPhysics(opt-in viaenableMagneticSnap). - Platform-aware physics tuning (iOS/macOS softer rubber-band, Android stiffer).
- Configurable
flickSensitivitymultiplier onDefaultSheetPhysics. SheetPhysics.magneticForce()abstract method with default no-op implementation.- Dual-mode example app with navigation hub for both page-driven and list-driven demos.
- Commerce-style list-driven example (product list, preview, detail, persistent cart bar).
Changed #
SheetScaffoldbarrier tap now callsclearSelection()when in list-driven mode (falls back tocollapse()otherwise).SheetController._onAnimationStatusnow handles deferred selection clearing via_pendingClearSelectionflag.DefaultSheetPhysicsusesflickSensitivitymultiplier in snap resolution.
Migration from 0.1.x #
No breaking changes. All existing MorphingSheet(...) usage works identically.
New features are accessed via MorphingSheet.listDriven<T>(...) and the new SheetController selection API.
0.1.0 - 2026-03-03 #
Added #
- Core
MorphingSheetwidget with multi-stage snap points (collapsed, half-expanded, fully expanded). SheetController(extendsChangeNotifier) for state-management-agnostic integration.- Physics engine with abstract
SheetPhysicsandDefaultSheetPhysicsimplementation. - Velocity-based snap resolution with configurable thresholds.
- Rubber-band resistance at sheet bounds.
- Continuous animation progress (0.0-1.0) driving all visual interpolations.
- Background scale + blur transform driven by sheet progress.
- Horizontal
PageViewswitching (disabled at fully-expanded state). - Custom curve presets (
SheetCurves) optimized for sheet motion. TransitionSpecfor per-element animation intervals.SheetConfigfor full customization of snap points, curves, radii, elevation, and background effects.- Sealed
SheetVisualStatehierarchy for type-safe state matching. - Example app demonstrating all three sheet states with horizontal pages.