toggle method

Future<void> toggle()

Toggles the torch (flashlight) on/off.

Implementation

Future<void> toggle() async {
  if (_isEnabled) {
    await disable();
  } else {
    await enable();
  }
}