RouteBuildStage class
The zfa build route stage (spec 033, FR-002): scans a project's lib/
for @Route / @ZfaRoute annotations, validates the collected
configuration (FR-006), and compiles everything into the single generated
router file lib/src/routing/zfa_router.g.dart.
Lifecycle rules (spec edge cases):
- Validation errors → the stage FAILS and NO file is written.
- No annotations + no previous file → success, nothing written.
- No annotations + stale previous file → regenerated as a valid EMPTY configuration (removed routes never survive a rebuild).
- No annotations + stale file + no
go_routerdependency → the stale file is deleted (it could never compile) and a warning is reported.
Constructors
- RouteBuildStage({required String projectRoot, bool dryRun = false, bool verbose = false, ResolvedFeatureSet? featureSet})
Properties
- dryRun → bool
-
final
- featureSet → ResolvedFeatureSet?
-
Spec 030 (FR-004): when set,
@Routehits owned by DISABLED features (normalized name match on class name or file path) are dropped before the router emit — disabled features leave no routes/nav items (SC-001). Null = no filtering (behavior unchanged).final - hashCode → int
-
The hash code for this object.
no setterinherited
- projectRoot → String
-
Absolute or relative path of the project root (the directory holding
pubspec.yamlandlib/).final - routerFilePath → String
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- verbose → bool
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
) → Future< RouteBuildResult> - Run the stage. Never throws — failures are reported through RouteBuildResult.errors.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
isOwnedByDisabledFeature(
String name, ResolvedFeatureSet featureSet) → bool -
True when
name(a class name or file path segment) belongs to a feature disabled infeatureSet.
Constants
-
routeDecoratorNames
→ const List<
String> - Annotation names this stage scans for.