Initial commit of the Flutter Cursor Generator project, including the core generator tool, project brief schema, example project setup, and CI configuration. Added README documentation outlining repository structure, quick start guide, and detailed descriptions of features and architecture pillars.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
---
|
||||
description: "Auto Route conventions for {{PROJECT_NAME}}"
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Auto Route Standards — {{PROJECT_NAME}}
|
||||
|
||||
## Route definitions
|
||||
```dart
|
||||
@AutoRouterConfig()
|
||||
class AppRouter extends $AppRouter {
|
||||
@override
|
||||
List<AutoRoute> get routes => [
|
||||
AutoRoute(page: HomeRoute.page, initial: true),
|
||||
AutoRoute(page: ProductRoute.page, path: '/products/:id'),
|
||||
AutoRoute(page: LoginRoute.page, guards: [AuthGuard]),
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
## Navigation
|
||||
```dart
|
||||
context.router.push(ProductRoute(id: product.id));
|
||||
context.router.pop();
|
||||
context.router.replace(HomeRoute());
|
||||
```
|
||||
|
||||
## Rules
|
||||
- Always use typed `Route` classes — never string paths
|
||||
- Guards implement `AutoRouteGuard`
|
||||
- **NEVER** use `Navigator.push` directly
|
||||
Reference in New Issue
Block a user