withThe<T, R> function

R withThe<T, R>(
  1. T it,
  2. R block(
    1. T it
    )
)

Calls the specified function block with the given it as its argument and returns its result. Since Receiver not supported in Dart, you need call the argument object using dot notation. Although this function works same as the run function,we still implement it for better semantic reading.

Implementation

R withThe<T, R>(T it, R Function(T it) block) {
  return block(it);
}