handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Handles method calls over the MethodChannel of this plugin. Note: Check the "federated" architecture for a new way of doing this: https://flutter.dev/go/federated-plugins

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'getPlatformVersion':
      return getPlatformVersion();
    case 'decodeFile':
      return decodeFile(call.arguments['filename']);
    case 'decodeVideo':
      decodeVideo();
      break;
    case 'closeVideo':
      closeVideo();
      break;
    case 'setBarcodeFormats':
      return setBarcodeFormats(call.arguments['formats']);
    case 'getParameters':
      return getParameters();
    case 'setParameters':
      return setParameters(call.arguments['params']);
    case 'init':
      return initBarcodeSDK();
    case 'setLicense':
      return setLicense(call.arguments['license']);
    case 'decodeImageBuffer':
      return decodeImageBuffer(
          call.arguments['bytes'],
          call.arguments['width'],
          call.arguments['height'],
          call.arguments['stride'],
          call.arguments['format']);
    default:
      throw PlatformException(
        code: 'Unimplemented',
        details:
            'flutter_barcode_sdk for web doesn\'t implement \'${call.method}\'',
      );
  }
}