Read page as text

NIB / NIBMOTION

NibMotion — Flutter package guide

NibMotion connects state, motion values and interruptible drivers across gestures, layout, scroll, timelines and visual effects. Start with a target on one Flutter…

Open interactive view

One motion model. From a press to a whole interface.

NibMotion connects state, motion values and interruptible drivers across gestures, layout, scroll, timelines and visual effects. Start with a target on one Flutter widget; use the same model as the interaction grows. It depends only on the Flutter SDK.

Published on pub.dev · 0.3.6

flutter pub add nib_motion

Declarative motion

Describe an entrance, a selected state, or a complete keyframe sequence with NibAnim and NibTransition. Named variants let a parent coordinate its children.

Create your first animation

Transitions, variants and stagger

Compose keyframes

Physics and interactive gestures

Build a draggable card that coasts, meets a boundary, or snaps into place. Springs retarget from the current value and velocity, so another input can arrive before the last movement settles.

Retarget a spring

Gestures, bounds and snap

Inertia and custom simulations

Layout and presence

Reorder a list, expand a card, or let a removed item finish its exit while siblings reflow. Stable identity connects application state to measured layout and retained exits.

Layout and shared identity

Coordinate reflow and exits

Scroll and orchestration

Map scroll progress to paint, reveal content as it enters a viewport, or coordinate several controllers on one timeline. Use route transitions when the movement belongs to navigation.

Scroll-linked values

Seek a timeline

Animate navigation

Visual effects and expressive interfaces

Animate text units, follow a path, reveal a surface, or add glass and decorative water. These effects compose with ordinary Flutter widgets; GPU paths have explicit renderer limits.

Text and typewriter

Paths and stroke drawing

Shaders and glass

Water surfaces

Developer tooling, performance and accessibility

Tune a spring, inspect running values, and replay entrances during development. Profile the actual screen and provide the same useful outcome when reduced motion skips the travel.

Debug and tune springs

Measure performance

Design for reduced motion

Start here

Introduction

A unified Flutter motion system for state transitions, physics, layout, scroll, orchestration and visual effects.

Installation

Install the hosted package and inspect the version your app uses.

Start with motion

Build a short, staged entrance from opacity, vertical travel and timing.

Your first animation

Make saving an idea feel responsive with one state value and an interruptible spring.

Accessibility

Keep the state change clear when motion is reduced or input differs.

Migrating an existing animation

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

States and timing

Transitions

Choose a timed tween or a spring, then set the return behavior.

Variants and stagger

Name related states and schedule children that inherit them.

Keyframes

Define the states of one motion sequence along normalized time.

Presets and ready-made motion

Choose an entrance, a repeating effect, or an action-triggered effect.

Motion lists

Stagger a short list while keeping item identity and layout explicit.

Physics and input

Springs and interruption

Keep an interaction responsive when its destination changes. Learn the spring model, tune its response, and handle interruption correctly.

Physics drivers

Understand the spring and inertia engines below the widgets.

Motion values

Connect changing data directly to paint properties.

Gestures

Respond to press, hover, focus, and direct manipulation.

Drag, pinch, and swipe

Use a standalone gesture widget when direct manipulation is the job.

Layout and presence

Layout animations

Animate a keyed child from its old measured place to its new one.

Presence

Keep a removed keyed child until its exit completes.

Layout and presence together

Let siblings reflow while a removed item completes its exit.

Scroll and orchestration

Scroll motion

Reveal content on entry or map scroll position to paint values.

Viewport motion and replay

Trigger on entry, track progress through a viewport, or replay on purpose.

Navigation motion

Animate route content or use the package’s bottom navigation shell.

Page and modal routes

Move a Navigator route while keeping dismissal and state ownership clear.

Controllers

Drive one or more NibMotion widgets from an imperative event.

Animation sequences

Queue targets, waits, callbacks, and a deliberate repeat mode.

Timeline

Schedule several controllers on one clock and scrub known states.

Text and effects

Text motion

Choose between animated units, typing, a gradient sweep, and a whole-block reveal.

Path motion

Draw a Path or move a child along its local geometry.

Shaders

Use bundled effects with asset and renderer fallbacks understood.

Water surfaces

Render decorative water over a bounded Flutter subtree, with visible sampling status and an honest fallback.

Tools and reference

Debugging and spring tuning

Tune a real spring, inspect motion values, and replay entrances without changing your production interaction.

Performance

Measure build, layout, paint, raster, and retention separately.

Platform limits

Separate source behavior, tested geometry, and device evidence.

Troubleshooting

Trace a still or misplaced animation to state, identity, and space.

API reference

Find the public entry point for a concrete animation job.