Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove .yaml file and fix errors
Rename 'readme_excerpts' generated file
Fix formatting errors
  • Loading branch information
mike-v2 committed Jan 25, 2024
commit b3c3e6a186a5d4e8c6a3cc0c74fec3db0faeb055
9 changes: 5 additions & 4 deletions packages/go_router_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
To use `go_router_builder`, you need to have the following dependencies in
`pubspec.yaml`.

<?code-excerpt "example/readme_excerpts.yaml (Dependencies)"?>
```yaml
dependencies:
# ...along with your other dependencies
Expand All @@ -28,7 +27,7 @@ generated file will always have the name `[source_file].g.dart`.
```dart
import 'package:go_router/go_router.dart';

part 'readme_excerpts.g.dart';
part 'example_builder_output.g.dart';
```

### Running `build_runner`
Expand Down Expand Up @@ -108,6 +107,8 @@ The tree of routes is defined as an attribute on each of the top-level routes:
routes: <TypedGoRoute<GoRouteData>>[
TypedGoRoute<FamilyRoute>(
path: 'family/:fid',
// ···
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's include the closing ) here, even though it'll mean an extra plaster. Same for similar cases later in the file; it's just less confusing if we don't have unbalanced ([{s.

),
// ···
],
)
Expand All @@ -119,7 +120,7 @@ class HomeRoute extends GoRouteData {
}

@TypedGoRoute<LoginRoute>(
path: '/login',
path: '/login'
)
class LoginRoute extends GoRouteData {
// ···
Expand Down Expand Up @@ -201,7 +202,7 @@ Parameters (named or positional) not listed in the path of `TypedGoRoute` indica
<?code-excerpt "example/lib/main.dart (QueryParameters)"?>
```dart
@TypedGoRoute<LoginRoute>(
path: '/login',
path: '/login'
)
class LoginRoute extends GoRouteData {
const LoginRoute({this.fromPage});
Expand Down
6 changes: 3 additions & 3 deletions packages/go_router_builder/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ class App extends StatelessWidget {
],
),
],
// #docregion RouteTree
),
// #enddocregion RouteTree
TypedGoRoute<FamilyCountRoute>(path: 'family-count/:count'),
// #docregion RouteTree
],
Expand All @@ -95,9 +97,7 @@ class HomeRoute extends GoRouteData {
// #enddocregion DefineRoute

// #docregion QueryParameters
@TypedGoRoute<LoginRoute>(
path: '/login',
)
@TypedGoRoute<LoginRoute>(path: '/login')
class LoginRoute extends GoRouteData {
// #enddocregion RouteTree
const LoginRoute({this.fromPage});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:flutter/material.dart';
// #docregion Import
import 'package:go_router/go_router.dart';

part 'readme_excerpts.g.dart';
part 'example_builder_output.g.dart';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we use different name for the generated file?

// #enddocregion Import

void main() {
Expand Down
12 changes: 0 additions & 12 deletions packages/go_router_builder/example/readme_excerpts.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be removed, per my other comment.

This file was deleted.