reorder method
If condition
is true then we call one
then two
.
If condition
is false then we call two
then one
.
Implementation
void reorder(
bool Function() condition, void Function() one, void Function() two) {
if (condition()) {
one();
two();
} else {
two();
one();
}
}