scanBarcode method

  1. @override
Future<String?> scanBarcode()
override

Implementation

@override
Future<String?> scanBarcode() async {
  try {
    debugPrint('MethodChannel: Invoking scanBarcode');
    final String? result =
        await methodChannel.invokeMethod<String>('scanBarcode');
    debugPrint('MethodChannel: scanBarcode result: $result');
    return result;
  } on PlatformException catch (e) {
    throw Exception('Barcode scan failed: ${e.message}');
  }
}