onBad method

void onBad(
  1. void fx(
    1. B reason
    )
)

Implementation

void onBad(void Function(B reason) fx) {
  if (isBad) {
    fx.call(reason);
  }
}