also method

T? also(
  1. void block(
    1. T it
    )
)

Executes block for side effects when non-null, returning the original receiver.

Implementation

T? also(void Function(T it) block) {
  final value = this;
  if (value == null) return null;
  block(value);
  return value;
}