typeArgumentsOf function

List<DartType> typeArgumentsOf(
  1. DartType type,
  2. TypeChecker checker
)

If type is the Type or implements the Type represented by checker, returns the generic arguments to the checker Type if there are any.

If the checker Type doesn't have generic arguments, null is returned.

Implementation

List<DartType> typeArgumentsOf(DartType type, TypeChecker checker) {
  final implementation = _getImplementationType(type, checker) as InterfaceType;

  return implementation.typeArguments;
}