EndpointGen class
A Generator
that scans classes extending Endpoints
and
generates corresponding router configuration code.
Responsibilities:
- Resolve model imports for DTOs used in
@Body
parameters. - Generate strongly typed handlers for endpoint methods.
- Validate and parse request parameters (
@Body
,@PathParam
,@QueryParam
). - Write generated code into a
generated/*.g.dart
file next to the source file.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
importsPaths
→ Map<
String, String> -
Stores model class → import path mapping,
used to add correct imports for request bodies.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
generate(
LibraryReader library, BuildStep buildStep) → FutureOr< String?> - Generates Dart code for an input Dart library.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveBodyImports(
BuildStep buildStep) → Future< void> -
Scans all files under
lib/
to collect model classes (classes extendingModel<T>
) for request body parsing. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited