getFocusState method

  1. @override
Future<Map<String, dynamic>> getFocusState()
override

Get current focus state

Implementation

@override
Future<Map<String, dynamic>> getFocusState() async {
  try {
    if (kDebugMode) {
      debugPrint('QuickQR Scanner: Getting focus state');
    }

    final result = await methodChannel.invokeMethod<Map<Object?, Object?>>('getFocusState');
    final focusState = Map<String, dynamic>.from(result ?? {});

    if (kDebugMode) {
      debugPrint('QuickQR Scanner: Focus state - $focusState');
    }

    return focusState;
  } on PlatformException catch (e) {
    throw _handlePlatformException(e, 'getFocusState');
  } catch (e) {
    throw ScannerException(
      ScannerErrorCode.internalError,
      'Failed to get focus state: $e',
    );
  }
}