mapIfOnType<E, R> method

R? mapIfOnType<E, R>(
  1. R f(
    1. E
    )
)

Implementation

R? mapIfOnType<E, R>(R Function(E) f) {
  final self = this;
  if (self is E) {
    return f(self);
  } else {
    return null;
  }
}