UiNavigationHost class

Renders the current stack of a UiNavigationController.

Edge-swipe pop (PR-E / PR-4 / PR-7)

iOS/macOS users expect an edge-drag from the left to pop the top page. UiNavigationStack intentionally does not participate in the Navigator/Route system (see its own docstring), so nothing in the default pipeline provides that gesture. UiNavigationHost adds an edge-swipe region that translates the top of the stack under the finger and calls UiNavigationController.pop when the release passes either the distance or velocity threshold.

The gesture is:

  • explicitly enabled via enableEdgeSwipePop. It is off by default.
  • stack-aware: only active when UiNavigationController.canPop is true. At the stack root the edge strip is absent so root-page scroll / hero gestures keep the full width.
  • strip-scoped: the detector occupies a narrow strip along the leading edge (edgeSwipeWidth wide).
  • interactive (PR-4): the current page translates under the finger while dragging. A release that doesn't meet threshold animates the page back; a release that meets it animates the page off-screen and then pops the stack.
  • layered parallax: when selected through backSwipeTransition, both the outgoing and incoming routes are rendered during the drag. The incoming route starts offset by -0.30 * width (LTR reading-start) and settles at 0 as the gesture completes; the outgoing route carries a leading-edge shadow for the elevation cue.
Inheritance

Constructors

UiNavigationHost({Key? key, required UiNavigationController controller, Widget builder(BuildContext context, UiRouteEntry entry)?, UiNavigationTransitionStyle transitionStyle = UiNavigationTransitionStyle.softShift, bool enableEdgeSwipePop = false, double edgeSwipeWidth = 22, double edgeSwipeMinDistance = 64, double edgeSwipeMinVelocity = 400, ValueNotifier<double>? edgeSwipeProgress, UiMotionDuration edgeSwipeSettleDuration = UiMotionDuration.slow, UiBackSwipeTransition backSwipeTransition = UiBackSwipeTransition.slide})
const

Properties

backSwipeTransition UiBackSwipeTransition
Back-swipe visual treatment. See UiBackSwipeTransition.
final
builder Widget Function(BuildContext context, UiRouteEntry entry)?
Optional custom entry renderer. When null, each entry is built by the UiRouteSpec registered with that id.
final
controller UiNavigationController
final
edgeSwipeMinDistance double
Horizontal distance the finger must travel from the edge before releasing for the gesture to complete.
final
edgeSwipeMinVelocity double
Primary horizontal velocity (pts/sec) that alone triggers a pop even if the distance threshold was not met.
final
edgeSwipeProgress ValueNotifier<double>?
Optional observer for the live drag progress (0..1). Fired on every drag update and while the release animation runs. Mostly useful for tests and for hosts that want to cross-fade supplementary chrome during a pop.
final
edgeSwipeSettleDuration UiMotionDuration
Timing used after an edge swipe is released.
final
edgeSwipeWidth double
Width in logical pixels of the leading-edge strip that starts the Width of the leading-edge gesture region.
final
enableEdgeSwipePop bool
Whether edge-swipe-to-pop is enabled.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transitionStyle UiNavigationTransitionStyle
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited