expandable_animation 0.5.0
expandable_animation: ^0.5.0 copied to clipboard
Flutter widget-to-fullscreen and card expansion animations with container morphing, spring physics and drag-to-dismiss. Not an accordion or ExpansionTile.
Changelog #
All notable changes to this package are documented here. This project follows Semantic Versioning.
0.5.0 #
- Fixed: releasing a dismiss drag made
ExpandableAnimationController.progressjump back up (to about0.95) before it fell. It now falls continuously from the value it had when the finger lifted. - Fixed: calling
expand()while a collapse was running made the view jump when that collapse came from a released drag or usedphysics. The new expansion now starts from the frame on screen. - Fixed: removing and re-adding an
ExpandableAnimationSlotwhile its shared element was in flight could throw while painting. - Tests: regression tests for every fixed bug, seeded random input sequences (taps, controller calls, back, drags) checked against invariants, frame continuity checks for interrupted transitions, and one-, two- and three-finger transitions.
0.4.1 #
- Fixed: in
ExpandableAnimationZoomable, a pinch that started with any vertical movement (a diagonal or up-and-down pinch, the usual way people pinch) was taken by drag-to-dismiss instead of zooming. Every finger on the zoomable area is now kept away from the surface's own dismiss drag; a one-finger drag still dismisses (forwarded by the zoomable), and two fingers always pinch.
0.4.0 #
- Faster background blur: the blur now keeps its full radius and fades in with opacity instead of animating its radius from zero. On a Snapdragon 765G phone this cut the 90th percentile raster time of a blurred transition from 12.5 ms to 7.6 ms, and frames over budget from 23 to 3 (plain content). The scrim and the final look are unchanged; mid-transition the blur cross-fades in instead of growing.
- Fixed: replacing an
ExpandableAnimationwith a new one that shares its controller in the same frame (for example after a key change or inside anAnimatedSwitcher) threw "can only be attached to one ExpandableAnimation". The replacement now takes the controller over and reports its own state. - Fixed: when the page holding an expanded source was removed together with
the expanded view (for example by
pushAndRemoveUntil), the controller stayed attached and kept reporting the old phase. - Tested and documented: nested navigators (
useRootNavigator: false), Android predictive back (committed gestures collapse, cancelled ones do not,PopScopecan veto), gestures inside the expanded view (sliders,Dismissible, horizontal lists, nested lists,DraggableScrollableSheet, text fields) and source lifecycle edge cases. - The example app enables Android predictive back.
- The package description now states that it is not an accordion or
ExpansionTilereplacement. - Added a test that the transition works inside a
CupertinoApp.
0.3.0 #
- Added
ExpandableAnimationSlot: shared element transitions inside the container transform. Slots with the same tag in the collapsed child and the expanded view fly on their own path, cross-fading and fitted into the moving bounds. - Added
ExpandableAnimation.tag: a view whose source was rebuilt while expanded collapses into the new source with the same tag instead of fading out. - Published measured profile-mode frame times for iPhone 12, a Snapdragon
765G Android phone and an M1 Pro MacBook Pro, with a reusable benchmark
(
example/benchmark).
0.2.0 #
- Added
ExpandableAnimationGestureConfig.dismissDirectionsandExpandableAnimationDismissDirection: dismiss by dragging down, up, left or right in any combination. Vertical lists dismiss past either end and horizontal scrollables (such asPageView) past their first or last page. - Added
ExpandableAnimationThemeandExpandableAnimationThemeDatafor app-wide defaults. Breaking: the themableExpandableAnimationparameters (for exampleduration,curve,mode,borderRadius,backgroundOpacity,gestureConfig) are now nullable fields; leaving one out uses the theme, then the previous default. Code that only passes values is unaffected. - Added
ExpandableAnimation.hoverScale: a subtle lift on mouse hover and keyboard focus, off by default. - Added
ExpandableAnimationZoomable: pinch, pan and double-tap zoom for expanded content that cooperates with drag-to-dismiss. Zoomed-in content pans instead of dismissing, and zooms back out when the view collapses. - A drag that dismisses the view now hands its speed to the collapse, using
the configured
physicsor a critically damped spring that settles in aboutreverseDuration. Opt out withExpandableAnimationGestureConfig.matchReleaseVelocity: false. - Fixed
ExpandableAnimationController.progressstaying at the drag value while a dragged view collapsed. - Documentation: platform support table now reflects integration tests run on the iOS Simulator, the Android emulator and macOS desktop.
0.1.0 #
Initial release.
ExpandableAnimation: widget-to-fullscreen container transform with position, size, border radius and surface color interpolation.- Expansion modes: fullscreen, dialog, sheet (partial expansion) and custom bounds. Dialog and sheet modes stay above the on-screen keyboard.
- Time-based motion (
duration,curve) or spring physics (ExpandableAnimationPhysics) withsmooth,bouncyandsnappypresets. - Background scrim with configurable color, opacity and optional blur.
- Interactive drag-to-dismiss with distance and velocity thresholds, spring
settle-back, haptic feedback and scrollable-content coordination
(
ExpandableAnimationGestureConfig). ExpandableAnimationControllerwithexpand,collapse,toggle,phase,progressandisDragging; transitions can be interrupted and reversed in both directions.- Lifecycle callbacks
onExpanded,onCollapsedandonPhaseChanged. - Back button, Escape key,
PopScope, focus, keyboard activation, semantics and reduced-motion support. - Custom layer transitions through
transitionBuilder.
