blob: 9d4b705530cffcf7f928821c4a34522cac35f45e [file] [log] [blame]
RouteBase get $namedRoute => GoRouteData.$route(
path: '/named-route',
name: 'namedRoute',
factory: $NamedRouteExtension._fromState,
);
extension $NamedRouteExtension on NamedRoute {
static NamedRoute _fromState(GoRouterState state) => NamedRoute();
String get location => GoRouteData.$location(
'/named-route',
);
void go(BuildContext context) => context.go(location);
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
void pushReplacement(BuildContext context) =>
context.pushReplacement(location);
void replace(BuildContext context) => context.replace(location);
}