maintain method
Maintains generated project files using the provided context.
Implementation
@override
Future<void> maintain(GeneratorContext context) async {
final router = context.template.router;
if (!router.enabled) return;
final routes = await const RouteResolver().resolve(context);
LoggerService.info('Discovered ${routes.length} routes.');
for (final route in routes) {
LoggerService.info(' • ${route.name} -> ${route.file}');
}
_validateRoutes(routes);
if (router.isGoRouter) {
await const GoRouterRenderer().render(context: context, routes: routes);
return;
}
throw UnsupportedError('Unsupported router strategy "${router.strategy}".');
}