Smart Navigation: Automatically finds and opens the corresponding widget file using import paths from routes.gr.dart
Real-time Updates: Refreshes when routes.gr.dart file is saved
Zero Configuration: Works out of the box with standard AutoRoute setups
How It Works
Route Detection: The extension scans your routes.gr.dart file to find route definitions
CodeLens Display: When you open a Dart file containing *Route classes, it shows inline "Jump to Definition" buttons
Smart Navigation: When you click a button, it:
Converts the widget name to snake_case (e.g., CompaniesScreen → companies_screen)
Finds the matching import in routes.gr.dart
Converts the package path to a file system path
Opens the correct file and focuses on the class definition
Requirements
Flutter project with AutoRoute package
Generated routes.gr.dart file at lib/routes.gr.dart
Usage
Install the extension
Open a Dart file containing route references (e.g., CompaniesRoute())
Look for the CodeLens button above the route class (e.g., "🔗 Jump to CompaniesScreen")
Click the button to navigate to the corresponding widget file
Example
// In your Dart file
context.router.push(const CompaniesRoute());
// The extension will:
// 1. Detect CompaniesRoute
// 2. Show "🔗 Jump to CompaniesScreen" button
// 3. When clicked, find this import in routes.gr.dart:
// import 'package:myapp/features/companies/screens/companies_screen.dart' as _i4;
// 4. Convert to: lib/features/companies/screens/companies_screen.dart
// 5. Open the file and focus on the CompaniesScreen class
File Structure Support
The extension automatically handles various project structures by reading import paths from routes.gr.dart: