ContextMethod class

Template-ready representation of an API method.

Params/body/query are represented as nested field trees so templates can generate request models and parameter classes.

Constructors

ContextMethod({required String methodName, required String methodNamePascalCase, List<NestedContextField>? params, List<NestedContextField>? body, List<NestedContextField>? query, required bool hasParams, required bool hasBody, required bool hasQuery, required bool hasUseCase, String? responseEntityName, String? responseEntityNameLower, String? responseEntityCamelCase, bool responseIsList = false, bool hasResponse = false})

Properties

body List<NestedContextField>?
final
hasBody bool
final
hashCode int
The hash code for this object.
no setterinherited
hasParams bool
final
hasQuery bool
final
hasResponse bool
False for void-return methods (no response key in multi-response mode).
final
hasUseCase bool
final
methodName String
final
methodNamePascalCase String
final
params List<NestedContextField>?
final
query List<NestedContextField>?
final
responseEntityCamelCase String?
camelCase entity name, e.g. "user". Used for variable names.
final
responseEntityName String?
PascalCase entity name this method returns, e.g. "User" or "Token". Null in single-response mode or when the method returns void.
final
responseEntityNameLower String?
lowercase entity name, e.g. "user". Used for import paths.
final
responseIsList bool
Whether the method returns a list of the entity.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited