switchControl method

String switchControl(
  1. bool on
)

Returns a styled switch/toggle control.

Displays " ON " or " OFF" based on the on state.

Implementation

String switchControl(bool on) {
  final col = on ? theme.checkboxOn : theme.checkboxOff;
  final sym = on ? glyphs.checkboxOnSymbol : glyphs.checkboxOffSymbol;
  final text = on ? ' ON ' : ' OFF';
  return '$col$sym$text${theme.reset}';
}