visitProvideExisting method
void
visitProvideExisting(
- int index,
- TokenElement token,
- Expression tokenExpression,
- Reference type,
- Expression redirect,
- bool isMulti,
override
Implement redirecting to redirect
when token
is requested.
Implementation
@override
void visitProvideExisting(
int index,
TokenElement token,
Expression tokenExpression,
Reference type,
Expression redirect,
bool isMulti,
) {
final methodName = '_getExisting\$$index';
_methodCache.add(Method((b) => b
..name = methodName
..returns = type
..body = refer('this.get').call([redirect]).code));
if (isMulti) {
_addToMulti(token, tokenExpression, methodName);
} else {
_addToBody(tokenExpression, methodName);
}
}