isGeneric method

  1. @override
bool isGeneric()
override

Returns true if this class declares generic type parameters.

Generic classes introduce one or more type variables that must be resolved at instantiation or use-site.

Example

class Box<T> {}

In this case, isGeneric() would return true.

Implementation

@override
bool isGeneric() => getTypeArguments().isNotEmpty || (getType().toString().contains("<") && getType().toString().endsWith(">"));