toOnOff method

String toOnOff()

Returns 'On' or 'Off'.

true.toOnOff()  // 'On'
false.toOnOff() // 'Off'

Implementation

String toOnOff() => this ? 'On' : 'Off';