visitProvideValue method
void
visitProvideValue(
- int index,
- TokenElement? token,
- Expression tokenExpression,
- Reference returnType,
- Expression value,
- bool isMulti,
override
Implement providing value
when token
is requested.
Implementation
@override
void visitProvideValue(
int index,
TokenElement? token,
Expression tokenExpression,
Reference returnType,
Expression value,
bool isMulti,
) {
final methodName = '_get${returnType.symbol}\$$index';
_methodCache.add(
Method(
(b) => b
..name = methodName
..returns = returnType
..body = value.code,
),
);
if (isMulti) {
_addToMulti(token, tokenExpression, methodName);
} else {
_addToBody(tokenExpression, methodName);
}
}