toggleFlashlight method

Future<void> toggleFlashlight(
  1. bool currentKnownState
)

Toggles the flashlight. Note: This is a blind toggle based on presumed state if not tracked natively. For robust usage, stick to setFlashlight(true/false) with your own state management.

Implementation

Future<void> toggleFlashlight(bool currentKnownState) async {
  await setFlashlight(!currentKnownState);
}