castOrNull<T> method
T?
castOrNull<T>()
Cast the object only if it is the type specified if it's not, just return null
Implementation
T? castOrNull<T>() => this is T ? cast<T>() : null;
Cast the object only if it is the type specified if it's not, just return null
T? castOrNull<T>() => this is T ? cast<T>() : null;