detect method

T detect(
  1. bool darkMode
)

Implementation

T detect(bool darkMode) => darkMode ? dark : light;