Skip to main content

expandable_animation 0.5.0 copy "expandable_animation: ^0.5.0" to clipboard
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.progress jump back up (to about 0.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 used physics. The new expansion now starts from the frame on screen.
  • Fixed: removing and re-adding an ExpandableAnimationSlot while 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 ExpandableAnimation with a new one that shares its controller in the same frame (for example after a key change or inside an AnimatedSwitcher) 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, PopScope can 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 ExpansionTile replacement.
  • 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.dismissDirections and ExpandableAnimationDismissDirection: dismiss by dragging down, up, left or right in any combination. Vertical lists dismiss past either end and horizontal scrollables (such as PageView) past their first or last page.
  • Added ExpandableAnimationTheme and ExpandableAnimationThemeData for app-wide defaults. Breaking: the themable ExpandableAnimation parameters (for example duration, 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 physics or a critically damped spring that settles in about reverseDuration. Opt out with ExpandableAnimationGestureConfig.matchReleaseVelocity: false.
  • Fixed ExpandableAnimationController.progress staying 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) with smooth, bouncy and snappy presets.
  • 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).
  • ExpandableAnimationController with expand, collapse, toggle, phase, progress and isDragging; transitions can be interrupted and reversed in both directions.
  • Lifecycle callbacks onExpanded, onCollapsed and onPhaseChanged.
  • Back button, Escape key, PopScope, focus, keyboard activation, semantics and reduced-motion support.
  • Custom layer transitions through transitionBuilder.
0
likes
160
points
168
downloads
screenshot

Documentation

API reference

Publisher

verified publisherboffincoders.com

Weekly Downloads

Flutter widget-to-fullscreen and card expansion animations with container morphing, spring physics and drag-to-dismiss. Not an accordion or ExpansionTile.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#animation #transition #expandable #fullscreen #gesture

License

MIT (license)

Dependencies

flutter

More

Packages that depend on expandable_animation