run<R> method

R run<R>(
  1. R op()
)

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

Example:

var result = 'Hello'.run(() => 'Hello World');
print(result); // Output: Hello World

Implementation

R run<R>(R Function() op) => op();