Repository: flutter
Issue: [go_router_builder][go_router] `.location`, `.go(context)` and `.push(context)` are only defined in the generated extension
Labels: c: new feature,package,c: proposal,P3,p: go_router,p: go_router_builder,team-go_router,triaged-go_router

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Use case

Right now, the generation creates an extension on each pages: 


```dart
// routes.dart
@TypedGoRoute< MyRoute1 >(path: '/my-route-1')
class MyRoute1 extends GoRouteData {
  const MyRoute1();

  @override
  Widget build(BuildContext context) => const MyScreen2();
}

@TypedGoRoute< MyRoute2 >(path: '/my-route-1')
class MyRoute2 extends GoRouteData {
  const MyRoute2();

  @override
  Widget build(BuildContext context) => const MyScreen2();
}
```

```dart
// routes.g.dart
extension $MyRoute1Extension on MyRoute1 {
  static MyRoute1 _fromState(GoRouterState state) => const MyRoute1();

  String get location => GoRouteData.$location(
        '/my-route-1',
      );

  void go(BuildContext context) => context.go(location, extra: this);

  void push(BuildContext context) => context.push(location, extra: this);
}

extension $MyRoute2Extension on MyRoute2 {
  static MyRoute2 _fromState(GoRouterState state) => const MyRoute2();

  String get location => GoRouteData.$location(
        '/my-route-2',
      );

  void go(BuildContext context) => context.go(location, extra: this);

  void push(BuildContext context) => context.push(location, extra: this);
}
```

But because of that, when manipulating a `GoRouteData` object, we cannot use `go`, `push` or `location`.

```dart
GoRouteData route;

route.go(context); // <- Error
```

This also prevents us from creating an extension on `GoRouteData` that reuses those methods:

```dart
extension on GoRouteData {
  void customGo(BuildContext context) {
    go(context); // <- Not possible
  } 
}
```


<!--
     Please tell us the problem you are running into that led to you wanting
     a new feature.

     Is your feature request related to a problem? Please give a clear and
     concise description of what the problem is.

     Describe the alternative solutions you've considered. Is there a package
     on pub.dev/flutter that already solves this?
-->

## Proposal

It would be nice if the generated code doesn't work with extension (like what [`freezed`](https://pub.dev/packages/freezed) does) for example

```dart
abstract class GoRouteMethods {
  void go(BuildContext context);
}

class MyRoute extends GoRouteData with _$MyRoute implements GoRouteMethods {}
```

<!--
     Briefly but precisely describe what you would like Flutter to be able to do.

     Consider attaching something showing what you are imagining:
      * images
      * videos
      * code samples

     Does this have to be provided by Flutter directly, or can it be provided
     by a package on pub.dev/flutter? If so, maybe consider implementing and
     publishing such a package rather than filing a bug.
-->