Trace<T extends TraceRoute> class

Represents a semantic navigation event.

A Trace object encapsulates all the information needed for a navigation action: a destination path, the arguments args, and the presentation style traceRoute.

This class is designed to be extended to create a centralized, type-safe, and semantic navigation API for your application.

Example:

class AppTraces extends Trace {
  AppTraces._({required super.path, super.args, super.traceRoute});

  factory AppTraces.toProfile(String userId) {
    return AppTraces._(
      path: '/profile',
      args: ProfileArgs(userId: userId),
    );
  }
}

// Usage:
AppTraces.toProfile('123').push(context);

Constructors

Trace({required String path, T? traceRoute, RouteParams? args})
const

Properties

args RouteParams?
final
hashCode int
The hash code for this object.
no setterinherited
path String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
traceRoute → T?
final

Methods

cleanAndPush(BuildContext context) Future
findMeOrPush(BuildContext context) Future
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
popToFirstAndPush(BuildContext context) Future
push(BuildContext context) Future
pushAndReplacement(BuildContext context) Future
toString() String
A string representation of this object.
inherited

Operators

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