Milad-Akarie / auto_route_library

Flutter route generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Using variable names with '$' creates syntax errors in generated file.

iamsupercode opened this issue · comments

To Reproduce:

  • Create A Page that takes a parameter named user$id
  • Register Page in autoroutes
  • Run flutter packages pub run build_runner build --delete-conflicting-outputs
  • Check app_route.gr.dart for syntax errors

In my case the result is this result below. Note the bolded text.

`
// ....app_route.gr.dart
final String venue$id;

@OverRide
String toString() {
return 'ReservationBuilderRouteArgs{key: $key, onCreateReservation: $onCreateReservation, venue$id: $venue$id}';
}`

i don't know, why use $ for naming variable, just try revoke $ at your naming variable. it will solve the problem.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions