visit method Null safety

void visit(
  1. void f(
    1. int r,
    2. int c
    )
)

Implementation

void visit(void Function(int r, int c) f) {
  for (int r = 0; r < rows; r++) {
    for (int c = 0; c < columns; c++) {
      f(r, c);
    }
  }
}