repeat method Null safety

void repeat(
  1. void forEach(
      )
    )

    Implementation

    void repeat(void forEach()) {
      assert(this > -1);
      for (int i = 0; i < this; i++) {
        forEach();
      }
    }