Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typedef not recognized as int in path parameters #2053

Open
Anmonpi opened this issue Sep 6, 2024 · 0 comments
Open

Typedef not recognized as int in path parameters #2053

Anmonpi opened this issue Sep 6, 2024 · 0 comments

Comments

@Anmonpi
Copy link

Anmonpi commented Sep 6, 2024

When using auto_route_generator 9.0.0, typedefs on parameters are not recognized as the type they have assigned, and the code generator throws the error:

Parameter [typedefParameter] must be of a type that can be parsed from a [String] because it will also obtain it's value from a path
valid types: [String, int, double, num, bool, dynamic]

Example:
Using the typedef:

typedef TypedefParameter = int;

In the page:

@RoutePage()
class InboxMessageDetailsPage extends StatelessWidget
    with
        StateProviderMixin<InboxMessageDetailsController,
            InboxMessageDetailsState> {
  const InboxMessageDetailsPage({
    super.key,
    @PathParam() required this.inboxMessageId,
  });

  final TypedefParameter inboxMessageId;
...
}
@Anmonpi Anmonpi changed the title Typedef not recognized as int Typedef not recognized as int on path parameters Sep 6, 2024
@Anmonpi Anmonpi changed the title Typedef not recognized as int on path parameters Typedef not recognized as int in path parameters Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant