toOnOff property

String get toOnOff

Returns 'on' if this boolean is true, and 'off' if this boolean is false.

Example: true.toOnOff -> 'on'.

Implementation

String get toOnOff => this ? 'on' : 'off';