UiRouteSpec<TArgs, TResult> class

A typed route definition.

TArgs describes the argument shape expected by the route (pass void for argument-less routes). TResult describes the value the route resolves with when it pops. A controller built on UiRouteSpecs enforces these types at runtime, producing useful assertion failures when a screen is pushed with mismatched args.

Annotations

Constructors

UiRouteSpec({required String id, required Widget builder(BuildContext context, TArgs args), String? title, String titleBuilder(TArgs args)?})
const

Properties

builder Widget Function(BuildContext context, TArgs args)
Content builder. The second argument is the typed payload passed to UiNavigationController.push.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique route identifier.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
Human-readable title for the history menu. Defaults to id.
final
titleBuilder String Function(TArgs args)?
Optional dynamic title resolver used for history/back labels.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveTitle(Object? args) String?
toString() String
A string representation of this object.
override

Operators

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