Skip to content

[go_router_builder] Example in the README is wrong for default values #121129

@ValentinVignal

Description

@ValentinVignal

Steps to Reproduce

In the README.md of go_router_builder, the example is wrong for the default values section:

https://github.com/flutter/packages/blob/6f1b1e899465aaeb624e28c0d90aa5dc865cef3f/packages/go_router_builder/README.md?plain=1#L182-L196

It is

class MyRoute extends GoRouteData {
  MyRoute({this.queryParameter = 'defaultValue'});
  final String from;

  @override
  Widget build(BuildContext context, GoRouterState state) => MyScreen(from: from);
}

But it should be

class MyRoute extends GoRouteData {
  MyRoute({this.queryParameter = 'defaultValue'});
  final String queryParameter;

  @override
  Widget build(BuildContext context, GoRouterState state) => MyScreen(queryParameter: queryParameter);
}

It was introduced in flutter/packages#2826

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listp: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions