isSubtypeOf<U> method

bool isSubtypeOf<U>(
  1. RuntimeType<U> other
)

Whether this is a subtype of other.

A class B is a subtype of A if an instance of B is assignable to A. For example, List is a subtype of Iterable, but not a subtype of String.

Note that a given class T is considered to be a subtype of itself.

Implementation

bool isSubtypeOf<U>(RuntimeType<U> other) => other.isSupertypeOf(this);