reorder method

void reorder(
  1. bool condition(),
  2. void one(),
  3. void two()
)

Implementation

void reorder(
    bool Function() condition, void Function() one, void Function() two) {
  if (condition()) {
    one();
    two();
  } else {
    two();
    one();
  }
}