releaseReleasedEvent: Published:

Ark Navigation 2.1: explicit operations on typed destinations

Call push and replacement operations on typed destinations, preserve result types and choose nested placement explicitly without generating routing files.

Call the operation on the typed destination

Ark Navigation 2.1 lets a destination expose its navigation operations directly. The destination already defines its input and result types, so the call needs neither repeated result-type arguments nor generated routing files.

final NavigationTicket<bool> ticket =
    const ProductDestination(productId: 'keyboard-42').push(context);

Outside widgets, destination.on(navigation).push() selects an explicitly supplied NavigationPort. A Presenter or another consumer does not need a global router or ambient Zone-based selection.

Operation names describe the stack change

push adds an entry. replaceTop replaces the top entry with a new instance. reconfigureTop updates a matching top entry while keeping its identity and ticket. replaceAll leaves that destination as the only entry in the target stack. pushAndRemoveUntil retains an anchor, removes entries above it and adds the destination.

For push operations, ticket.committed reports whether navigation committed, while ticket.completed reports how the entry ended. The result type is preserved from the destination through completion. A Guard rejection is not reported as a successful transition.

Nested placement stays explicit

BuildContext selects the nearest session; the Graph still determines target placement. Calling a root destination from a button inside a nested tab does not silently move that destination into the tab's stack.

When the same destination has several placements, placed(mountId: ..., scopeId: ...) selects one explicitly. Ambiguous placement produces a failure rather than picking the first matching mount.

The new calls delegate to the existing Controller, Guard, Redirect, history and lifecycle pipeline. Existing navigation.push(destination) calls remain supported. Existing-entry operations such as pop, and multi-destination stack rewrites, remain responsibilities of NavigationPort.

Try the release

ark_navigation 2.1.0 is available on pub.dev. The destination-operations guide covers typed results, explicit ports and Mount/Scope selection. The first-route tutorial shows application setup.

This release does not change the native back-gesture boundary: the new call syntax does not implement iOS swipe-back or Android predictive-back.

ARKTELOS CHANNELS

News and engineering material, without mixing languages.

The main channels cover ArkTelos development. ArkTelos Lab publishes architecture analysis, experiments, and reproducible research.