cast<T> function
T?
cast<T>(
- dynamic x
Casts x to T if it is of that type, otherwise returns null.
Implementation
T? cast<T>(dynamic x) => x is T ? x : null;
Casts x to T if it is of that type, otherwise returns null.
T? cast<T>(dynamic x) => x is T ? x : null;