Read page as text

NIB / DOCUMENTATION

Migrating an existing animation — NibMotion

Move one interaction from implicit widgets or an AnimationController to state targets, while preserving layout and ownership.

Open interactive view

Keep the screen, change one interaction

Keep your state management, layout and business callbacks. Select a small animation with a clear endpoint and keyboard action. Replace its paint animation, compare the behavior, then decide whether more of the screen benefits.

These guides were checked against nib_motion 0.3.5. Version 0.3.6 is published on pub.dev. Shader rendering needs checks on your target device.

Map responsibility before syntax

These are Flutter concepts, not automatic source translations. Existing AnimationControllers remain useful when another API requires an Animation<double>.

Existing responsibilityNibMotion entry pointKeep in mind
Implicit target changeNibMotion + animate: NibAnim(...)x/y are paint offsets, not layout constraints.
Controller-driven start/stopNibMotionControllerCreate once; dispose the owner.
Tween timingNibTransition(duration:, curve:)A spring instead uses physical settling.
Gesture position and releaseNibDragConfig + MotionValueKeep bounds and velocity in local pixels.
A timed multi-step sequenceNibKeyframe / NibTimelineUse explicit starts for reproducible seeks.
Removed list itemNibPresence + stable keys + exitApplication state still owns membership.
Measured layout changeNibMotion(layout:) + NibLayoutScopeRespect the documented geometry limits.

Test interruption before migrating the next screen

Change the target again before settling. Navigate away while motion runs. Check focus, hit targets, reduced motion, controller cleanup and final state. Avoid replaying by changing a key unless you intend to reset local State.

Effects from other libraries may combine several properties. Compose NibAnim fields or keyframes for the same job; do not assume a matching preset name has identical timing or lifecycle behavior.

Build the first state-driven animation

Controller ownership

Accessibility and reduced motion

Explore the complete example application

The NibMotion gallery includes 29 examples: the original 21 demos, Daily Focus, two quick starts and five additional examples. It is included with the published 0.3.6 release. Its README has local launch instructions.

Review the 29-example gallery and launch instructions