detect method

T detect(
  1. bool isActivated
)

Implementation

T detect(bool isActivated) => isActivated ? active : inactive;