flip_layout 0.2.1
flip_layout: ^0.2.1 copied to clipboard
Declarative layout & presence animations — enter/exit + FLIP reflow for any layout. A Framer Motion for Flutter.
0.2.1 #
Documentation hygiene — no behaviour changes.
- The README no longer carries version numbers. The status line restated the
release and Install pinned
^0.2.0; both had to be edited every release, and that is exactly what went stale in a sibling package (a README describing a shipped release as a prerelease, served by pub.dev for the whole release).pubspec.yamlis the version,CHANGELOG.mdis the history, the pub.dev badge renders the current number. Install is nowflutter pub add flip_layout. - New:
test/docs_freshness_test.dart— fails the suite if the README contains a version literal, ifCHANGELOG.md's newest entry doesn't matchpubspec.yaml, or if a public type has no entry indoc/API.md. - New:
test/readme_snippets_test.dart— compile-checks (and mounts) every Dart snippet in the README anddoc/API.mdagainst the real API: theMotionGroupexample, the layered shared-element pattern,crossFade/flightShuttleBuilder,MotionConfig, both spring flavours,LayoutMotion, and every documented constructor argument acrossMotionGroup,LayoutMotion,AnimatedLayout,MotionSharedScopeandMotionConfig. SharedElementControlleris recorded in the guard's allowlist as internal — it is exported only because the whole library file is, and is reachable solely through a private lookup. Dropping it from the public export is on the roadmap.
0.2.0 #
Stable release of the 0.2.0 line (the 0.2.0-dev.* notes below are the full
feature history). Headline additions since 0.1.x:
MotionSpring— a velocity-preserving spring for position slides, so a reorder mid-slide carries the element's momentum into the new target.- Shared-element flight polish —
MotionSharedScope.flightShuttleBuilderandcrossFade. MotionGrouplifecycle —onEnter(key)/onExitComplete(key)callbacks andexitStagger, plus a one-time debug warning pastdebugChildCountWarningThreshold(default 150).- Example: a new Stress tab — an in-app performance harness with a live
FPS / build / raster / jank readout, driving a single
MotionGroupup to 300 churning children. - Docs: the README now has a measured Performance section.
All public API additions are backward compatible with 0.1.x.
0.2.0-dev.1 #
Prerelease of the 0.2.0 line for testing on pub.dev before the stable cut.
- New:
MotionSpring— a velocity-preserving spring for position slides. UnlikeSpringCurve(a fixed-duration spring look), it drives the slide with a liveSpringSimulationon an unbounded controller, so a re-order mid-slide carries the element's momentum into the new target. Wire it via a newspring:argument onLayoutMotion/MotionGroup, or aspring:default onMotionConfig.SpringCurvestill works for the simple curve path. - New: shared-element flight polish —
MotionSharedScope.flightShuttleBuilder(render a fully custom in-flight widget, given the source and destination children + the flight animation) andMotionSharedScope.crossFade(the built-in flight dissolves source→destination instead of carrying only the destination child). The example Shared tab now cross-fades tile→detail. - New:
MotionGrouplifecycle + exit stagger —onEnter(key)/onExitComplete(key)callbacks and anexitStaggerso a batch of leaving children cascade out one-after-another. The example Add/remove tab shows both (a "Clear" button + a live status line). - New: large-collection guard —
MotionGroupprints a one-time debug warning when its child count exceedsMotionGroup.debugChildCountWarningThreshold(default 150), since it isn't virtualised. README/SPEC steer big lists toAnimatedList/SliverAnimatedList. - Docs: documented the shared-element birth-order heuristic and its limits
in
doc/ARCHITECTURE.md; SPEC/ROADMAP/README updated for the above. - Tests: added coverage for the flight shuttle + cross-fade, three-holder birth-order pick, rapid open/close and flight-interrupted-by-flight, spring slide + velocity-continuous re-target, the large-count warning, and the lifecycle callbacks + exit stagger.
- All public API additions are backward compatible with
0.1.x.
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.