configureBarkoder method

Future<void> configureBarkoder(
  1. BarkoderConfig barkoderConfig
)

Configures the Barkoder functionality based on the provided configuration.

barkoderConfig: The BarkoderConfig object containing the configuration settings.

Example usage:

BarkoderConfig config = BarkoderConfig(
  pinchToZoomEnabled: true,
  beepOnSuccessEnabled: true,
  // Add other configuration settings here
);
_barkoder.configureBarkoder(config);
print('Barkoder configured successfully.');

Implementation

Future<void> configureBarkoder(BarkoderConfig barkoderConfig) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'configureBarkoder', jsonEncode(barkoderConfig));
}