downFrom function

void downFrom(
  1. int n,
  2. dynamic callback(
    1. int i
    )
)

Do the callback n times, argument decreases

Implementation

void downFrom(int n, Function(int i) callback) {
  for (var i = n; i > 0; i--) {
    callback(i);
  }
}