also method

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

Executes block with this for side effects, then returns this.

Useful for logging or debugging in a fluent chain:

fetchData().also((d) => print('Got: $d')).process();

Implementation

T also(void Function(T it) block) {
  block(this);
  return this;
}