> For the complete documentation index, see [llms.txt](https://gdgaddis.gitbook.io/mobile-development-reference-tce-c01/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gdgaddis.gitbook.io/mobile-development-reference-tce-c01/routing/setting-up-router.md).

# Setting up router

After that let's create the configuration needed for the router. First, create the "router.dart" file under src/router/ with the following code.

```dart
import 'package:auto_route/auto_route.dart';
import 'package:auto_route/auto_route_annotations.dart';
import 'package:flutter/cupertino.dart';
// Import your products_screen.dart 
export 'router.gr.dart';

@MaterialAutoRouter(routes: [
  MaterialRoute(page: ProductsScreen, initial: true),
])
class $Router {}


```

After this run, the command "pub run build\_runner build" on the terminal of the project to generate the router source code. After running it you should see a "router.gr.dart" file next to it where the generated source code is written.

What the above code basically does is register a new route for "ProductsScreen" and make it the initial route.
