cast<T> function

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

Casts x to the specified type T if it is an instance of T. Null if x is not an instance of T

since 0.0.1

Implementation

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