flip_layout 0.1.0
flip_layout: ^0.1.0 copied to clipboard
Declarative layout & presence animations — enter/exit + FLIP reflow for any layout. A Framer Motion for Flutter.
0.1.0 #
- New:
MotionSharedScope+MotionSharedId— shared-element "magic move" transitions within a page (grid→detail, list→hero) with no route change, the thing Flutter'sHeroonly does across routes. Example gains a Shared tab. - New:
SpringCurve— a tunable spring (mass/stiffness/damping) as aCurve, for overshoot-and-settle slides anywhere a curve is accepted. - New:
MotionConfig— setduration/curve/staggerdefaults for a subtree once, and honour reduced-motion (config flag, or the OS accessibility setting automatically) by skipping animations.LayoutMotion/MotionGroupduration/curve/staggerare now nullable and inherit from it. - New:
MotionGroup.exitTransitionBuilder— give leaving children a different transition from entering ones. - New:
LayoutMotionslides are now interruptible — a layout change mid-slide re-targets from the current on-screen position instead of snapping to 0, so rapid reorders/filters stay smooth (also benefitsMotionGroup). - New:
MotionGroup— a declarative collection animator that does enter/exit (anAnimatePresenceequivalent) + layout (FLIP) in any layout (Wrap,GridView,Column, …). Just change thechildrenlist. Supportsstagger,animateInitial, and a customtransitionBuilder. - Example: redesigned around
MotionGroup— Filter (aWrapthat no built-in animates), Reorder (FLIP + stagger), and Add/remove (enter/exit). The old Expand demo was removed (that'sAnimatedSize/ExpansionTile's job, and mixing FLIP with a continuous resize caused jitter). Runs on web; deep-linkable via?demo=<id>. - Docs: README repositioned around
MotionGroupwith screenshots and a "When not to use this" section;docs/renamed todoc/(pub convention); added pubspec topics. - Bundles all
0.0.2fixes below.
0.0.2 #
- Fix: measurement now reads the untransformed layout position (via a
MetaDataproxy above theTransform), so an in-flight animation no longer contaminates the next measurement — eliminates jitter/oscillation. - Fix: inside a
Scrollable, positions are measured in scroll content space, so plain scrolling no longer triggers spurious slide animations. - Fix: the resting transform settles exactly to identity on completion.
- Fix: degenerate (zero-size / offstage) transitions are skipped instead of animating a bogus delta.
- API: added
onEndcallback;AnimatedLayoutforwardsanimateSizeand asserts each wrapped child has a key. - Docs: added
docs/SPEC.md; added tests for the FLIP inverse, scroll invariance, the key assertion, andonEnd.
0.0.1 #
- Initial scaffold:
LayoutMotionwidget (FLIP-based auto layout animation) andAnimatedLayoutconvenience wrapper.