cast<T> function

T? cast<T>(
  1. Object? x
)

If x is an instance of T, returns x cast to T, otherwise returns null.

since 0.0.1

Implementation

T? cast<T>(Object? x) => x is T ? x : null;