setWhiteBalanceMode method
Set white balance mode
Implementation
@override
Future<Map<String, dynamic>> setWhiteBalanceMode(WhiteBalanceMode whiteBalanceMode) async {
try {
if (kDebugMode) {
debugPrint('QuickQR Scanner: Setting white balance mode to ${whiteBalanceMode.value}');
}
final result = await methodChannel.invokeMethod<Map<Object?, Object?>>(
'setWhiteBalanceMode',
{'whiteBalanceMode': whiteBalanceMode.value}
);
final whiteBalanceState = Map<String, dynamic>.from(result ?? {});
if (kDebugMode) {
debugPrint('QuickQR Scanner: White balance mode set - $whiteBalanceState');
}
return whiteBalanceState;
} on PlatformException catch (e) {
throw _handlePlatformException(e, 'setWhiteBalanceMode');
} catch (e) {
throw ScannerException(
ScannerErrorCode.internalError,
'Failed to set white balance mode: $e',
);
}
}