castOrNull<T> function

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

Implementation

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