auto_go_route_generator 2.0.0
auto_go_route_generator: ^2.0.0 copied to clipboard
Code generator for auto_go_route. Turns route annotations into type-safe go_router routes, typed URL builders and navigation extensions.
2.0.0 #
Matches auto_go_route 2.0.0. See the
migration guide.
Fixed #
analyzeris no longer pinned to^7.0.0. That constraint's supported language version is 3.9.0, so on Dart 3.10+ every build failed withMissing implementation of visitDotShorthandPropertyAccess. The range is now>=8.2.0 <15.0.0, migrated off the retiredelement2.dartelement model, and a regression test builds a fixture using post-3.9 syntax (#3).- A
parent:cycle is reported as a build error instead of spinning forever. - The whole-package annotation scan now filters on source text before resolving a library, and runs once rather than twice.
required_inputs: ['.dart']removed — it forced this builder to wait behind every other Dart generator and pulled generated libraries into its own scan.- Discovery failures are fatal instead of logged below default verbosity.
- Output is byte-stable: assets are visited in sorted order and sibling sorting is total.
- The graph is keyed on
library#ClassName, so same-named widgets in different libraries no longer collide. @AutoGoRouteBasedefaults are read through top-level getters outsidebuildRouter, whose parameters share their names —onEnter: 'onEnter'emittedonEnter: onEnter ?? onEnterand lost the default.- Generated helpers call through
this, so a parameter namedlocation,goorpushno longer shadows the method it forwards to. - Redirects from a shell's own path are emitted before pattern routes that
would otherwise swallow them, are skipped over a real route at the same path,
default to the shell's first child, and the root-shell redirect no longer
shadows a route declared at
/. - A root stateful shell's
/redirect honours the first branch's@AutoGoRouteBranch(initialLocation:); a first branch whose route takes path parameters used to be skipped, landing/on the second tab. - A router library outside
lib/also scans its own top-level directory. - The
source_genfloor is 4.1.1, the first release withTypeChecker.typeNamedLiterally; 4.0.1 could not compile the generator. - The
globfloor is 2.2.0. Under 2.1.3,lib/**/*.dartmatched no file directly insidelib/, so routes declared there were silently missing.
Added #
- Typed parameter generation driven by the widget's declared types, with
@PathParam/@QueryParam/@RouteExtra/@RouteIgnoreoverrides read from the field as well as the parameter. - Full go_router parity across all four annotations, a
buildRouterthat accepts everyGoRouteroption, and generatedlocationOf…,replaceInPlaceWith…,routeName,routeTemplateand route-enum output. - Build-time validation with actionable messages: unresolvable function
references, non-identifier route names, colliding helper names, duplicated or
optional path parameters, two
extraparameters, a required query parameter with no default, conflicting error handlers, andmetadatavalues that cannot be re-emitted as source. - More build errors, each of which previously produced uncompilable code or a
startup assertion: a shell with no children,
navigatorKey/observerson a stateful shell, a branch with no parameter-free landing route, a nested shell'sinitialRouteoutside its branch, parameters namedqueries,fragmentorextra, enum-reserved route names, and an annotated widget or parameter type not visible from the router library. - A
source_globsbuilder option,@AutoGoRouteBase(sourceGlobs:), and a warning when two unscoped routers share a package (detected on the resolved annotation, so a comment mentioning it does not trigger it). - Generated
buildRoutingConfig()/buildDynamicRouter()for dynamic routing, and a branch enum per stateful shell. List<bool>,List<num>,List<BigInt>,List<DateTime>andList<Uri>query parameters.- 99 tests covering emitted output, every build error, determinism, and a check that the resolved analyzer keeps up with the SDK's language version.
Changed #
- Requires Dart
>=3.10.0. Dropped thecode_builderanddart_styledependencies: output is emitted as plain source and formatted byPartBuilderwith the input library's own language version.
1.1.0 #
- Dependency updates.
1.0.9 #
- Add support for analyzer 7.0.0.
1.0.8 #
- Add support for pageBuilder.
- Enhance routing capabilities with new bottom sheet navigation features
1.0.7 #
- Add support for extra parameters.
- Fix nested routes.
1.0.6 #
- Add support for shell routes.
1.0.5 #
- Fix pushRoute and pushToRoute methods to return Future<T?> instead of void.
1.0.4 #
- Fix redirect condition in AutoGoRouteGenerator to use fullPath instead of matchedLocation for accurate routing behavior.
1.0.3 #
- Queries are now optional.
1.0.2 #
- Added support for query parameters.
1.0.1 #
- Fixed some bugs.
1.0.0 #
- Initial release.