isSimilarType<S, T> function

bool isSimilarType<S, T>()

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?>();