We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given this file:
typedef Strings = List<String>; @RoutePage() class TestPage extends StatelessWidget { const TestPage({ super.key, this.strings = const [], }); final Strings strings; @override Widget build(BuildContext context) => const Placeholder(); }
auto_route_generator fails to produce the routes file with an error like:
auto_route_generator
line 109, column 133 of .: Expected an identifier. ╷ 109 │ class TestPageRoute extends _i47.PageRouteInfo<TestPageRouteArgs> {TestPageRoute({_i48.Key? key, _i46.Strings strings = const _i46. [], List<_i47.PageRouteInfo>? children, }) : super(TestPageRoute.name, args: TestPageRouteArgs(key: key, strings: strings, ), initialChildren: children, ); │ ^^ ╵ line 109, column 133 of .: Expected to find '('. ╷ 109 │ class TestPageRoute extends _i47.PageRouteInfo<TestPageRouteArgs> {TestPageRoute({_i48.Key? key, _i46.Strings strings = const _i46. [], List<_i47.PageRouteInfo>? children, }) : super(TestPageRoute.name, args: TestPageRouteArgs(key: key, strings: strings, ), initialChildren: children, ); │ ^^ ╵ line 109, column 134 of .: Expected an identifier. ╷ 109 │ class TestPageRoute extends _i47.PageRouteInfo<TestPageRouteArgs> {TestPageRoute({_i48.Key? key, _i46.Strings strings = const _i46. [], List<_i47.PageRouteInfo>? children, }) : super(TestPageRoute.name, args: TestPageRouteArgs(key: key, strings: strings, ), initialChildren: children, ); │ ^ ╵ line 117, column 88 of .: Expected an identifier. ╷ 117 │ class TestPageRouteArgs {const TestPageRouteArgs({this.key, this.strings = const _i46. [], }); │ ^^ ╵ line 117, column 88 of .: Expected to find '('. ╷ 117 │ class TestPageRouteArgs {const TestPageRouteArgs({this.key, this.strings = const _i46. [], }); │ ^^ ╵ line 117, column 89 of .: Expected an identifier. ╷ 117 │ class TestPageRouteArgs {const TestPageRouteArgs({this.key, this.strings = const _i46. [], }); │ ^ ╵
The most relevant part is that it tried to add a namespace to the array literal:
_i46.Strings strings = const _i46. []
It works fine if we write List<String> directly like this:
List<String>
final List<String> strings;
This is a regression from auto_route_generator v5, which handled typedefs well.
The text was updated successfully, but these errors were encountered:
For comparison, auto_route_generator v5.0.2 produced simply const []. I don't know when exactly the regression was introduced.
const []
Sorry, something went wrong.
No branches or pull requests
Given this file:
auto_route_generator
fails to produce the routes file with an error like:Full output
The most relevant part is that it tried to add a namespace to the array literal:
It works fine if we write
List<String>
directly like this:This is a regression from
auto_route_generator
v5, which handled typedefs well.The text was updated successfully, but these errors were encountered: