switchDataCapture method

Future<void> switchDataCapture({
  1. required String targetPlugin,
  2. Map<String, dynamic>? paramList,
  3. String? commandTag,
  4. bool requestResult = true,
  5. bool includeApplicationPackage = true,
})

Switches the active data capture plugin.

targetPlugin is the plugin to switch to (e.g., DataWedgePluginName.barcode). paramList optionally provides parameters for the target plugin. includeApplicationPackage when true, includes the app package in the intent.

Implementation

Future<void> switchDataCapture({
  required String targetPlugin,
  Map<String, dynamic>? paramList,
  String? commandTag,
  bool requestResult = true,
  bool includeApplicationPackage = true,
}) {
  return sendIntent(
    extras: <String, dynamic>{
      DataWedgeApi.switchDataCapture: targetPlugin,
      if (paramList != null && paramList.isNotEmpty)
        DataWedgeApi.paramListKey: paramList,
    },
    targetPackage: DataWedgeApi.dataWedgePackage,
    commandTag: commandTag ?? 'SWITCH_DATACAPTURE_$targetPlugin',
    requestResult: requestResult,
    includeApplicationPackage: includeApplicationPackage,
  );
}