apply method

T apply(
  1. void op()
)

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

Example:

var list = [1, 2, 3].apply(() => print('List has ${list.length} elements'));
// Output: List has 3 elements

Implementation

T apply(void Function() op) {
  op();
  return this;
}