safeAs<T> method

T? safeAs<T>()

Implementation

T? safeAs<T>() {
  if (this is T) {
    return this as T;
  } else {
    return null;
  }
}