letAsOrNull<T> function
T?
letAsOrNull<T>(
- dynamic input
Let's you cast input
to a T
type if possible, or returns null
if the
cast cannot be performed.
Implementation
T? letAsOrNull<T>(dynamic input) => input is T ? input : null;