also method

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

Calls the specified function op with this value as its argument and returns this value.

Example:

var person = Person('John').also((it) => it.name = 'Doe');
print(person.name); // Output: Doe

Implementation

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