Skip to content
Back to skills

Flutter Go Router Navigation

ASecurity

Use a `GoRouteData` route with a required constructor parameter. The `go_router_builder` generator maps `orderId` to the `:orderId` segment and makes an untyped navigation call unnecessary. ```dart import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; part 'app_router.g.dart'; @TypedGoRoute<OrderDetailRoute>(path: '/orders/:orderId') class OrderDetailRoute extends GoRouteData { const OrderDetailRoute({required this.orderId}); final String orderId; @override Widget...

  • 584 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 5, 2026
developmentgo

Security analysis

A100/100

Pro scans all 12 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill flutter-go-router-navigation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Flutter Go Router Navigation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Flutter Go Router Navigation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-flutter-go-router-navigation-agent-skills-standard/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-flutter-go-router-navigation-agent-skills-standard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
Use a `GoRouteData` route with a required constructor parameter. The `go_router_builder` generator maps `orderId` to the `:orderId` segment and makes an untyped navigation call unnecessary.

```dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

part 'app_router.g.dart';

@TypedGoRoute<OrderDetailRoute>(path: '/orders/:orderId')
class OrderDetailRoute extends GoRouteData {
  const OrderDetailRoute({required this.orderId});

  final String orderId;

  @override
  Widget build(BuildContext context, GoRouterState state) {
    return OrderDetailScreen(orderId: orderId);
  }
}

class OrderDetailScreen extends StatelessWidget {
  const OrderDetailScreen({super.key, required this.orderId});

  final String orderId;

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(title: const Text('Order details')),
        body: Center(child: Text('Order: $orderId')),
      );
}

final GoRouter appRouter = GoRouter(routes: $appRoutes);
```

Navigate only through the route type:

```dart
OrderDetailRoute(orderId: order.id).push(context);
// or replace the current location:
OrderDetailRoute(orderId: order.id).go(context);
```

`orderId` cannot be omitted at the call site. Register `appRouter` once in dependency injection and pass it to `MaterialApp.router`; do not construct routers per screen or call `context.go('/orders/...')` with raw paths.

Files in this skill

  • eval-1.baseline.md1.7 KB
  • eval-1.with-skill.md1.4 KB
  • eval-2.baseline.md2.1 KB
  • eval-2.with-skill.md1.9 KB
  • eval-3.baseline.md2.8 KB
  • eval-3.with-skill.md3.2 KB
  • trigger-1.md134 B
  • trigger-2.md118 B
  • trigger-3.md100 B
  • trigger-4.md131 B
  • trigger-5.md116 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.