handleSingleClick method

void handleSingleClick()

Implementation

void handleSingleClick() async {
  Timer? _timer;
  // First call to switchCameraPreview
  await switchCameraPreview();

  // Start a timer that fires again after 2 seconds
  _timer = Timer(Duration(seconds: 1), () async {
    await switchCameraPreview(); // Second call to switchCameraPreview

    // Cancel the timer after it completes its task
    _timer?.cancel();
    _timer = null; // Optional: Set the timer to null for safety
  });
  EnxSetting.instance.setCameraPosition(!EnxSetting.instance.isFontCamera);
}