AppRouter class

Marks the single router entrypoint for a Flutter application.

initial and notFound are route paths, not page classes. Dust validates that both paths match generated @AppRoute pages.

Example:

@AppRouter(initial: '/', notFound: '/404')
final class RootRouter extends $RootRouter {
  RootRouter({required this.auth});

  final AuthViewModel auth;
}

Constructors

AppRouter({required String initial, required String notFound})
Creates a router root annotation.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
initial String
Initial route path, for example /.
final
notFound String
Not-found route path, for example /404.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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