callMeOnTaken method

void callMeOnTaken(
  1. void request(
    1. Box oldBox,
    2. Box newBox
    )
)

request is a function that takes two arguments, the old box and the new box.

You can add as many requests as you like, they would be called after box being changed by the order of adding.

Implementation

void callMeOnTaken(void Function(Box oldBox, Box newBox) request) {
  _requests.add(request);
}