isSubtype<S, T> function

bool isSubtype<S, T>()

Determines whether S is a subtype of T or T?.

isSubtype<Calendar, IInspectable>(); // true
isSubtype<IUnknown, IInspectable>(); // false

Implementation

bool isSubtype<S, T>() => <S>[] is List<T> || <S>[] is List<T?>;