getTypeParameters abstract method

List<Class> getTypeParameters()

Gets all generic type parameters of this class.

Returns:

  • List of type parameters in declaration order
  • Empty list for non-generic classes

Example:

class Box<T, V> {}
final params = Class.forType<Box>().getTypeParameters();
print(params.length); // 2

Implementation

List<Class> getTypeParameters();