instantiate method
instantiates the type parameters of this element with the given type
Implementation
@override
DartType instantiate(NamedDartType typeRef) {
Substitution substitution = Substitution.fromPairs(
typeParameters,
typeRef.typeArguments,
);
return substitution.substituteType(type, isNullable: typeRef.isNullable);
}