toggleFlashlight method
Toggles the native device flashlight (Torch) inside the AR Session. Returns true if successful, false if unsupported or failed.
Implementation
Future<bool> toggleFlashlight({required bool state}) async {
try {
final bool? success = await _channel.invokeMethod<bool>('toggleFlashlight', {
'state': state,
});
return success ?? false;
} catch (e) {
print('Error caught toggling AR flashlight: ' + e.toString());
return false;
}
}