cast<T> function

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

cast a variable to a type

Implementation

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