Read page as text

NIB / DOCUMENTATION

Page and modal routes — NibMotion

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

Open interactive view

Push a page with a visible endpoint

NibPageRoute is a PageRoute. Pass a builder to Navigator.push and let the Navigator own the route lifetime. Its default content starts transparent and 32 logical pixels lower, then reaches NibAnim.identity. Popping uses the starting pose as the default exit. The default transition is a spring. duration controls the route entrance; reverseDuration is a minimum exit lifetime and grows if the spring needs longer to settle.

Keep page data and decisions in the destination widget as usual. A route animation should not become the only way to understand which page is open. Press Back during entrance and check that the content heads toward its exit without briefly returning to the start pose.

Navigator.of(context).push(
  NibPageRoute<void>(
    builder: (_) => const Scaffold(
      body: Center(child: Text('Details')),
    ),
  ),
);
APITypeDefaultBehavior
backSwipeboolfalseEnable the start-edge interactive pop gesture.
parallaxdouble0.3Fractional shift of the covered route during a back swipe above it.
maintainStatebooltrueKeep the covered page state alive.

Test an interrupted back swipe

backSwipe is off by default. When enabled, a drag from the start-edge strip follows the pointer; releasing beyond 40 percent of page width or with a fast fling pops, while a shorter gesture springs back. The direction mirrors in right-to-left layouts. parallax shifts the route below only during that interactive gesture, and zero disables the effect.

Test a cancelled drag, a committed drag, a fast fling, and a pop while entrance is still running. Check the edge hit target against any control placed there. A compiled route cannot establish physical touch behavior, so perform these interactions on the platform you claim to support.

Mark the source of a shared transition

Give a NibSharedSource a GlobalKey and pass the same key as sharedFrom to NibPageRoute, NibModalRoute, or showNibDialog. The source keeps its layout space while the route stands in for it, then reappears when the route leaves. Without the wrapper, a plain GlobalKey can still provide geometry, but its source remains visible beneath the route.

Keep the source mounted long enough for the transition to measure it. A shared pose depends on rectangles across the source and destination; perspective, nearly singular transforms, and clipped overlays are outside the current verified geometry contract. Test focus and hit targets when the source is hidden and restored.

final sourceKey = GlobalKey(); // Keep in State.

NibSharedSource(
  sourceKey: sourceKey,
  child: const Icon(Icons.photo),
)

// In a button callback:
Navigator.of(context).push(
  NibPageRoute<void>(
    sharedFrom: sourceKey,
    builder: (_) => const Scaffold(body: Icon(Icons.photo)),
  ),
);

Choose route motion for a navigation job

Use NibScreenStack and NibNavBar for persistent tab screens; use NibPageRoute for a pushed page and NibModalRoute for an overlay with a result. These solve different ownership problems. Continue to Navigation for tab state retention and to Accessibility for reduced motion and focus checks.