as<T> method

T? as<T>()

Casts the receiver object to the given type T or returns null otherwise.

Implementation

T? as<T>() => (this is T) ? this as T : null;