nib_motion library
Declarative animation primitives for Flutter — Framer Motion-style physics-based animations with zero AnimationController boilerplate.
Classes
-
DerivedMotionValue<
S, T> - A MotionValue whose value is computed from a source MotionValue.
- InertiaSolver
- Drives a MotionValue<double> with a decelerating "coast to a stop" simulation, using the same friction model iOS uses for scroll deceleration.
-
MotionValue<
T> -
A reactive container for a single animatable value of type
T. - NibAnim
-
An immutable snapshot of every visual property
NibMotioncan animate. - NibAnimationSequence
- A fluent builder for a sequence of animation steps driven against a single NibMotionController.
- NibAnimPresets
-
A library of common, ready-to-use animations for
NibMotion. - NibBounce
- Plays a "drop in from above and bounce" entrance animation on child using NibAnimPresets.bounceIn.
- NibDissolve
- Dissolves child in or out using a noise-pattern fragment shader, instead of a uniform opacity fade.
- NibDragConfig
-
Configuration for
NibMotion.drag. - NibDraggable
- A higher-level drag widget with boundaries, axis locking, and snap-back.
- NibDrawPath
- Animates the drawing of path — like a signature or SVG stroke animation.
- NibDrawPathController
- Imperative handle for controlling a NibDrawPath's reveal animation.
- NibFlip
- A 3D card-flip widget that reveals back in place of front (or vice versa) when isFlipped changes.
- NibFloat
- Gently floats child up and down forever, like it's drifting in zero gravity.
- NibGradientText
-
Renders text once, then paints an animated gradient sweep across it by
masking the gradient onto the text's painted pixels via
BlendMode.srcIn. - NibInViewConfig
- Configures when NibMotion.whileInView triggers, based on how much of the widget is visible within the screen.
- NibKeyframe
-
One point in a multi-step animation driven by
NibMotion.keyframes. - NibLayoutGroup
- Animates children to their new positions whenever a rebuild changes their layout, using the FLIP (First, Last, Invert, Play) technique.
- NibMotion
- Declarative, physics-based animation for a single child.
- NibMotionConfig
-
Global configuration for
NibMotionwidgets. - NibMotionController
-
External handle for driving one or more NibMotion widgets' animations
imperatively — equivalent to Framer Motion's
useAnimationControls(). - NibMotionDebugger
-
A conditional debug overlay for
nib_motionapps. - NibMotionGate
-
Global gate that holds
NibMotionentrance animations at their initial frame until the app signals that it's actually visible to the user. - NibMotionList
- Wraps children in NibMotion, staggering each child's animation start by staggerDelay multiplied by its position (per staggerDirection).
- NibMotionProvider
-
Convenience root widget that configures NibMotionConfig and (in debug
builds) NibMotionDebugger-style diagnostics for every descendant
NibMotion. - NibMotionRegistry
- A global, debug-only registry of live MotionValues.
- NibMotionReplayScope
- Provides a NibMotionReplaySignal to descendant NibMotion widgets.
- NibMotionReplaySignal
-
A signal that, when fired via replay, tells every descendant
NibMotion with an entrance animation (
initial/animate/keyframes) to replay it from scratch — as if it had just been built for the first time. - NibMotionSequenceStep
- A single step in a NibMotionController.sequence.
- NibMotionValues
- Pre-built MotionValues to drive a NibMotion's animatable properties directly, bypassing its internal spring/tween animation system.
- Optional badge overlay on a NibNavItem.
- An animated navigation bar that renders items as evenly spaced tabs.
-
Paints the background, active-item indicator, and item labels of a
NibNavBar. Icons are rendered as real widgets (seeNibNavBar.build), not by this painter — see that class's doc comment for why. -
Visual appearance of a
NibNavBar's container. -
The visual indicator that moves between active items in a
NibNavBar. -
One tab in a
NibNavBarorNibScaffold. -
Per-item animation configuration for a
NibNavBar. - One screen managed by a NibScreenStack.
-
Configures the screen transition played by
NibScreenStackwhen the active tab changes. -
Resolves the enter/exit NibAnim pair played by
NibScreenStackfor each NibNavTransitionType. - NibParallax
- Moves child at a different rate than the surrounding scroll view, creating a depth/parallax effect.
- NibPathMotion
- Animates child's position (and optionally rotation) along a custom Path.
- NibPathMotionController
- Imperative handle for controlling a NibPathMotion's traversal.
- NibPerfOverlay
-
A small live FPS counter overlay, intended for use inside debug tooling
such as
NibMotionDebuggerbut usable standalone. - NibPinch
- Pinch-to-zoom gesture with animated spring snap-back.
- NibPresence
- Orchestrates exit animations for a dynamic list of children.
- NibPulse
-
Plays a repeating "heartbeat" pulse animation on child using
NibAnimPresets.pulse, looping forever via
NibMotion.repeatAnimationInLoop. - NibRubberBand
- Plays a rubber-band overshoot-and-settle animation on child once, using NibAnimPresets.rubberBand.
- NibScaffold
- A top-level, tab-based app shell that composes NibScreenStack and NibNavBar.
- NibScreenStack
- Manages screens as a stack of always-mounted widgets, animating the outgoing and incoming screens simultaneously when currentIndex changes.
- NibScrollMotion
- Creates a ScrollMotionBridge for controller and exposes it to builder, disposing it when this widget is removed.
- NibScrollReveal
- Reveals child with an animation when it scrolls into the viewport.
- NibShake
- Plays a rapid left-right shake animation on child, commonly used for input validation feedback.
- NibShakeController
- Imperative handle for triggering NibShake's shake animation on demand.
- NibShimmer
- Paints a GPU-accelerated diagonal shimmer sweep over child.
- NibSpringDescription
- Describes the physical properties of a spring used to drive a MotionValue toward a target via SpringSolver.
- NibSwipeDismiss
- Swipes a widget horizontally (or vertically) to dismiss it, with a threshold and spring-back.
- NibText
- Renders text (or span) split into independently animated character, word, or line units (see NibTextConfig.unit), each staggered in by NibTextConfig.staggerDelay.
- NibTextConfig
- Configures how NibText splits and animates its text.
- NibTextReveal
- Reveals child (typically a block of text) by animating a clip mask that wipes in from direction — the whole block reveals at once, with no per-character splitting.
- NibTimeline
-
Plays a list of NibTimelineEntrys in time order, dispatching each
entry's
controller.start(target:, transition:)at its NibTimelineEntry.at offset from when play was called. - NibTimelineEntry
- A single scheduled animation in a NibTimeline.
- NibTransition
- Describes how a NibMotion animation should run: either a curve-based tween with a fixed duration, or real spring physics via spring.
- NibTypewriter
- Reveals text character by character at speed, with an optional blinking cursor.
- RenderNibDissolve
- Paints child dissolved by the noise shader described by program, with dissolve progress driven by progress.
- RenderNibDrawPath
- Paints only the portion of path revealed by the current progress.
- RenderNibGradientText
-
Paints text once via a
TextPainter, then paints it again through an animated gradient usingsaveLayer+BlendMode.srcIn, so only the glyphs' pixels are tinted by the gradient. The gradient's sweep position comes from offset, aMotionValue<double>ticked by the owning state'sTicker— this render object only listens and repaints, it never drives the animation itself. - RenderNibMotion
- Paints a child with reactive transform, opacity, color, and clip properties driven by MotionValues.
- RenderNibPathMotion
- Translates (and optionally rotates) child to the point on path at the current progress.
- RenderNibShimmer
- Paints child with the shimmer FragmentShader composited over it.
- RenderNibTextReveal
-
Clips its child according to factor (
0.0fully clipped away,1.0fully visible), wiping in from direction. - ScrollMotionBridge
- Mirrors a ScrollController's scroll offset into MotionValues so it can drive animations directly, with no AnimationController involved.
- SpringSolver
- Drives a MotionValue<double> toward a target using real spring physics.
Enums
- DismissDirection
- The axis (and, for horizontal/vertical, the allowed direction) a NibSwipeDismiss can be swiped in.
- NibDissolveDirection
- Which direction a NibDissolve animation runs.
- NibDragReleaseMode
-
How a draggable
NibMotionsettles once the drag gesture ends. - The edge of a NibScaffold that its NibNavBar is docked to.
-
The visual style of the active-item indicator drawn by a
NibNavBar. -
The style of screen transition played by
NibScreenStackwhen the active tab changes. - NibStaggerDirection
- Which end of NibMotionList.children animates first.
- NibTextRevealDirection
- The edge from which a NibTextReveal wipes its child into view.
- NibTextStaggerFrom
- Where the per-unit stagger delay accumulates from, when NibText computes each unit's entrance delay.
- NibTextUnit
- The granularity at which NibText splits its text into animated units.
- NibTransitionType
- Whether a NibTransition is driven by curve-based tweening or by spring physics.
Extensions
-
MotionValueMapRange
on MotionValue<
double> - Adds mapRange to numeric MotionValues.
- NibDurationExtension on int
-
Shorthand for constructing Durations, e.g.
200.msinstead ofDuration(milliseconds: 200). - NibMotionWidgetExtension on Widget
-
Shorthand methods for wrapping a Widget in common
nib_motionprimitives.
Functions
-
computeAnimFromKeyframes(
List< NibKeyframe> keyframes, double t, Curve defaultCurve) → NibAnim -
Computes the NibAnim at progress
talongkeyframes. -
motionValue<
T> (T initial) → MotionValue< T> -
Creates a MotionValue holding
initialas its starting value.
Typedefs
-
BoxShadowMotionValue
= MotionValue<
List< BoxShadow> ?> -
A MotionValue holding an animatable list of BoxShadows, or
nullfor "no shadow". -
ColorMotionValue
= MotionValue<
Color?> -
A MotionValue holding an animatable background color, or
nullfor "no color". -
NibVariants
= Map<
String, NibAnim> -
A named set of NibAnim states that
NibMotion.initial/NibMotion.animatecan reference by name (instead of a literal NibAnim), and that descendantNibMotions with their ownvariantscan react to via propagation.