onBlock method

void onBlock(
  1. void listener(
    1. int blockNumber
    )
)

Add a listener to be triggered for each new Block;

Implementation

void onBlock(void Function(int blockNumber) listener) =>
    on('block', listener);