isSimilarType<S, T> function
Determines whether S
is the same type as T
or T?
.
isSimilarType<String?, String>(); // true
isSimilarType<String?, String?>(); // true
Implementation
bool isSimilarType<S, T>() => isSameType<S, T>() || isSameType<S, T?>();