Flutter - barKoder SDK API Reference

Barkoder class: #

getBarkoderResolution #

                Future <BarkoderResolution> getBarkoderResolution
            

Retrieves the resolution for barcode scanning.

returns a Future<BarkoderResolution> that completes with a BarkoderResolution enum value.

Example usage:

                BarkoderResolution resolution = await _barkoder.getBarkoderResolution;

            

Implementation:

                Future<BarkoderResolution>get getBarkoderResolutionasync {
if (_isBarkoderViewNotMounted) {
return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

returnawait _methodChannel
      .invokeMethod('getBarkoderResolution')
      .then((index) {
return BarkoderResolution.values[index];
  });
}

            

startScanning(resultsCallback) #

                Future<void> startScanning(resultsCallback)
            

Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed.

resultsCallback: A function to handle the scanning results.

Example usage:

                _barkoder.startScanning((result) {
  _updateState(result, false);
});
print('Scanning started');

            

Implementation:

                Future<void> startScanning(void Function(BarkoderResult) resultsCallback) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  _clearScanningResultsStreamSubscription();
  _scanningResultsStreamSubscription = _scanningResultsStream.listen(
      (result) =>
          resultsCallback.call(BarkoderResult.fromJsonString(result)));

  return _methodChannel.invokeMethod('startScanning');
}

            

stopScanning() #

                Future<void> stopScanning()
            

Halts the barcode scanning process, stopping the camera from capturing and processing barcode information.

Example usage:

                await _barkoder.stopScanning();
print('Scanning stopped');

            

Implementation:

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

  _clearScanningResultsStreamSubscription();
  return _methodChannel.invokeMethod('stopScanning');
}

            

pauseScanning() #

                Future<void> pauseScanning()
            

Temporarily suspends the barcode scanning process, pausing the camera feed without completely stopping the scanning session

Example usage:

                await _barkoder.pauseScanning();
print('Scanning paused');

            

Implementation:

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

  _clearScanningResultsStreamSubscription();
  return _methodChannel.invokeMethod('pauseScanning');
}

            

setFlashEnabled(bool enabled)

                Future<void> setFlashEnabled(bool enabled)
            

Enables or disables the device's flash (torch) for illumination during barcode scanning

enabled: A boolean indicating whether to enable the flash.

Example usage:

                bool flashEnabled =true;
await _barkoder.setFlashEnabled(flashEnabled);
print('Flash enabled:$flashEnabled');

            

Implementation:

                Future<void> setFlashEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setFlashEnabled', enabled);
}

            

setZoomFactor(double zoomFactor)

                Future<void> setZoomFactor(double zoomFactor)
            

Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning

zoomFactor: The zoom factor to set.

Example usage:

                double zoom = 2.0;
await setZoomFactor(zoom);
print('Zoom factor set to:$zoom');


            

Implementation:

                Future<void> setZoomFactor(double zoomFactor) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setZoomFactor', zoomFactor);
}

            

setRoiLineColor(String hexColor)

                Future<void> setRoiLineColor(String hexColor)
            

Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed

hexColor: The color to set for the ROI line in hexadecimal format.

Example usage:

                String lineColor = '#00FF00';// Green color
_barkoder.setRoiLineColor(lineColor);
print('ROI line color set to:$lineColor');


            

Implementation:

                Future<void> setRoiLineColor(String hexColor) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setRoiLineColor', hexColor);
}

            

setRoiLineWidth(double lineWidth)

                Future<void> setRoiLineWidth(double lineWidth)
            

Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed

*lineWidth: The width to set for the ROI line.*

Example usage:

                double lineWidth = 2.0;
_barkoder.setRoiLineWidth(lineWidth);
print('ROI line width set to:$lineWidth');

            

Implementation:

                Future<void> setRoiLineWidth(double lineWidth) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setRoiLineWidth', lineWidth);
}

            

setRoiOverlayBackgroundColor(String hexColor) 

                Future<void> setRoiOverlayBackgroundColor(String hexColor)
            

Sets the background color of the region of interest (ROI) overlay.

*hexColor: The color to set for the ROI overlay background in hexadecimal format.*

Example usage:

                String backgroundColor = '#FFA500';// Orange color
_barkoder.setRoiOverlayBackgroundColor(backgroundColor);
print('ROI overlay background color set to:$backgroundColor');


            

Implementation:

                Future<void> setRoiOverlayBackgroundColor(String hexColor) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setRoiOverlayBackgroundColor', hexColor);
}

            

setCloseSessionOnResultEnabled(bool enabled) #

                Future<void> setCloseSessionOnResultEnabled(bool enabled)
            

Enables or disables the automatic closing of the scanning session upon detecting a barcode result

*enabled: A boolean indicating whether to enable closing the session on result.*

Example usage:

                bool closeSessionEnabled =true;
_barkoder.setCloseSessionOnResultEnabled(closeSessionEnabled);
print('Close session on result enabled:$closeSessionEnabled');


            

Implementation:

                Future<void> setCloseSessionOnResultEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setCloseSessionOnResultEnabled', enabled);
}

            

setImageResultEnabled(bool enabled) #

                Future<void> setImageResultEnabled(bool enabled)
            

Enables or disables the capturing and processing of image data when a barcode is successfully detected.

*enabled: A boolean indicating whether to enable image result.*

Example usage:

                bool imageResultEnabled =true;
_barkoder.setImageResultEnabled(imageResultEnabled);
print('Image result enabled:$imageResultEnabled');

            

Implementation:

                Future<void> setImageResultEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setImageResultEnabled', enabled);
}

            

setLocationInImageResultEnabled(bool enabled) #

                Future<void> setLocationInImageResultEnabled(bool enabled)
            

Enables or disables the inclusion of barcode location information within the image data result.

*enabled: A boolean indicating whether to enable location in image result.*

Example usage:

                bool locationInImageResultEnabled =true;
_barkoder.setLocationInImageResultEnabled(locationInImageResultEnabled);
print('Location in image result enabled:$locationInImageResultEnabled');


            

Implementation:

                Future<void> setLocationInImageResultEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setLocationInImageResultEnabled', enabled);
}

            

setLocationInPreviewEnabled( bool enabled) #

                Future<void> setLocationInPreviewEnabled( bool enabled)
            

Sets whether location in preview is enabled.

*enabled: A boolean indicating whether to enable location in preview.*

Example usage:

                bool locationInPreviewEnabled =true;
_barkoder.setLocationInPreviewEnabled(locationInPreviewEnabled);
print('Location in preview enabled:$locationInPreviewEnabled');

            

Implementation:

                Future<void> setLocationInPreviewEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setLocationInPreviewEnabled', enabled);
}

            

setPinchToZoomEnabled(bool enabled) #

                Future<void> setPinchToZoomEnabled(bool enabled)
            

Sets whether pinch to zoom is enabled.

*enabled: A boolean indicating whether to enable pinch to zoom.*

Example usage:

                bool pinchToZoomEnabled =true;
_barkoder.setPinchToZoomEnabled(pinchToZoomEnabled);
print('Pinch to zoom enabled:$pinchToZoomEnabled');

            

Implementation:

                Future<void> setPinchToZoomEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setPinchToZoomEnabled', enabled);
}

            

setRegionOfInterestVisible(bool visible) #

                Future<void> setRegionOfInterestVisible(bool visible)
            

Sets the visibility of the Region of Interest (ROI) on the camera preview.

*visible: A boolean indicating whether to make the ROI visible.*

Example usage:

                bool roiVisible =true;
await _barkoder.setRegionOfInterestVisible(roiVisible);
print('Region of interest set to visible:$roiVisible');


            

Implementation:

                Future<void> setRegionOfInterestVisible(bool visible) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setRegionOfInterestVisible', visible);
}

            

setRegionOfInterest(double left, double top, double width, double height) #

                Future<void> setRegionOfInterest(double left, double top, double width, double height)
            

Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes.

*left: The left coordinate of the ROI.*

*top: The top coordinate of the ROI.*

*width: The width of the ROI in percentage.*

*height: The height of the ROI in percentage.*

Example usage:

                double left = 10.0;
double top = 10.0;
double width = 80.0;
double height = 8.0;
_barkoder.setRegionOfInterest(left, top, width, height);
print('Region of interest set');

            

Implementation:

                Future<void> setRegionOfInterest(
    double left, double top, double width, double height) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setRegionOfInterest',
      {'left': left, 'top': top, 'width': width, 'height': height});
}

            

setBeepOnSuccessEnabled(bool enabled) #

                Future<void> setBeepOnSuccessEnabled(bool enabled)
            

Enables or disables the audible beep sound upon successfully decoding a barcode

*enabled: A boolean indicating whether to enable beep on success.*

Example usage:

                bool beepOnSuccessEnabled =true;
await _barkoder.setBeepOnSuccessEnabled(beepOnSuccessEnabled);
print('Beep on success enabled:$beepOnSuccessEnabled');

            

Implementation:

                Future<void> setBeepOnSuccessEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setBeepOnSuccessEnabled', enabled);
}

            

setVibrateOnSuccessEnabled(bool enabled) #

                Future<void> setVibrateOnSuccessEnabled(bool enabled)
            

Enables or disables the device vibration upon successfully decoding a barcode.

*enabled: A boolean indicating whether to enable vibrate on success.*

Example usage:

                bool vibrateOnSuccessEnabled =true;
await _barkoder.setVibrateOnSuccessEnabled(vibrateOnSuccessEnabled);
print('Vibrate on success enabled:$vibrateOnSuccessEnabled');

            

Implementation:

                Future<void> setVibrateOnSuccessEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setVibrateOnSuccessEnabled', enabled);
}

            

setLocationLineWidth(double lineWidth) #

                Future<void> setLocationLineWidth(double lineWidth)
            

Sets the width of the lines indicating the location of detected barcodes on the camera feed.

*lineWidth: The width to set for the location line.*

Example usage:

                double lineWidth = 2.0;
_barkoder.setLocationLineWidth(lineWidth);
print('Location line width set to:$lineWidth');

            

Implementation:

                Future<void> setLocationLineWidth(double lineWidth) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setLocationLineWidth', lineWidth);
}

            

setBarkoderResolution(BarkoderResolution resolution) #

                Future<void> setBarkoderResolution(BarkoderResolution resolution)
            

Sets the resolution for barcode scanning.

*resolution: The BarkoderResolution enum value to set.*

Example usage:

                BarkoderResolution resolution = BarkoderResolution.HIGH;
await _barkoder.setBarkoderResolution(resolution);
print('Barkoder resolution set to:$resolution');

            

Implementation:

                Future<void> setBarkoderResolution(BarkoderResolution resolution) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setBarkoderResolution', resolution.index);
}

            

setLocationLineColor(String hexColor) #

                Future<void> setLocationLineColor(String hexColor)
            

Sets the color of the lines used to indicate the location of detected barcodes on the camera feed.

*hexColor: The color to set for the location line in hexadecimal format.*

Example usage:

                String lineColor = '#FF0000';// Red color
_barkoder.setLocationLineColor(lineColor);
print('Location line color set to:$lineColor');

            

Implementation:

                Future<void> setLocationLineColor(String hexColor) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setLocationLineColor', hexColor);
}

            

setEncodingCharacterSet(String characterSet) #

                Future<void> setEncodingCharacterSet(String characterSet)
            

Sets the encoding character set for barcode scanning

*characterSet: The encoding character set to set.*

Example usage:

                String characterSet = 'utf-8';
_barkoder.setEncodingCharacterSet(characterSet);
print('Encoding character set set to:$characterSet');

            

Implementation:

                Future<void> setEncodingCharacterSet(String characterSet) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setEncodingCharacterSet', characterSet);
}

            

setDecodingSpeed(DecodingSpeed decodingSpeed) #

                Future<void> setDecodingSpeed(DecodingSpeed decodingSpeed)
            

Sets the decoding speed for barcode scanning.

*decodingSpeed: The DecodingSpeed to set.*

Example usage:

                DecodingSpeed speed = DecodingSpeed.fast;
_barkoder.setDecodingSpeed(speed);
print('Decoding speed set to:$speed');

            

Implementation:

                Future<void> setDecodingSpeed(DecodingSpeed decodingSpeed) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setDecodingSpeed', decodingSpeed.index);
}

            

getMaxZoomFactor() #

                Future<double> getMaxZoomFactor()
            

Retrieves the maximum available zoom factor for the device's camera

Returns a Future that completes with the maximum zoom factor.

Example usage:

                double maxZoom =await getMaxZoomFactor();
print('Maximum zoom factor:$maxZoom');

            

Implementation:

                Future<double> getMaxZoomFactor() {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel
      .invokeMethod('getMaxZoomFactor')
      .then((zoomFactor) => zoomFactor as double);
}

            

getLocationLineColorHex #

                Future<String> getLocationLineColorHex
            

Retrieves the hexadecimal color code representing the line color used to indicate the location of detected barcodes.

Returns a Future that completes with the color of the location line in hexadecimal format.

Example usage:

                String lineColor =await _barkoder.getLocationLineColorHex();
print('Location line color:$lineColor');

            

Implementation:

                Future<String> get getLocationLineColorHex async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getLocationLineColorHex');
}

            

getLocationLineWidth #

                Future<double> getLocationLineWidth
            

Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed.

Returns a Future that completes with the width of the location line.

Example usage:

                double lineWidth =await _barkoder.getLocationLineWidth();
print('Location line width:$lineWidth');

            

Implementation:

                Future<double> get getLocationLineWidth async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getLocationLineWidth');
}

            

 getRoiLineColorHex #

                Future<String> getRoiLineColorHex
            

Retrieves the hexadecimal color code representing the line color of the Region of Interest (ROI) on the camera preview

Returns a Future that completes with the color of the ROI line in hexadecimal format.

Example usage:

                String lineColor =await _barkoder.getRoiLineColorHex();
print('ROI line color:$lineColor');

            

Implementation:

                Future<String> get getRoiLineColorHex async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getRoiLineColorHex');
}

            

getRoiLineWidth #

                Future<double> getRoiLineWidth
            

Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview.

Returns a Future that completes with the width of the ROI line.

Example usage:

                double lineWidth =await _barkoder.getRoiLineWidth();
print('ROI line width:$lineWidth');

            

Implementation:

                Future<double> get getRoiLineWidth async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getRoiLineWidth');
}

            

getRoiOverlayBackgroundColorHex #

                Future<String> getRoiOverlayBackgroundColorHex
            

Retrieves the hexadecimal color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview.

Returns a Future that completes with the background color of the ROI overlay in hexadecimal format.

Example usage:

                String backgroundColor =await _barkoder.getRoiOverlayBackgroundColorHex();
print('ROI overlay background color:$backgroundColor');


            

Implementation:

                Future<String> get getRoiOverlayBackgroundColorHex async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getRoiOverlayBackgroundColorHex');
}

            

getRegionOfInterest #

                Future<List<double>> getRegionOfInterest
            

Retrieves the region of interest (ROI).

Returns a Future that completes with a list of doubles representing the region of interest left, top, width, height.

Example usage:

                List<double> roi =await _barkoder.getRegionOfInterest;
print('Region of interest:$roi');

            

Implementation:

                Future<List<double>> get getRegionOfInterest async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel
      .invokeMethod('getRegionOfInterest')
      .then((value) {
    return List.from(value);
  });
}

            

getThreadsLimit #

                Future<int> getThreadsLimit
            

Retrieves the threads limit.

Returns a Future that completes with an integer representing the threads limit.

Example usage:

                int threadsLimit =await _barkoder.getThreadsLimit;
print('Threads limit:$threadsLimit');

            

Implementation:

                Future<int> get getThreadsLimit async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getThreadsLimit');
}

            

setThreadsLimit(int threadsLimit) #

                Future<void> setThreadsLimit(int threadsLimit)
            

Sets the threads limit.

*threadsLimit: The number of threads to set as the limit.*

Example usage:

                int threadsLimit = 2;
_barkoder.setThreadsLimit(threadsLimit);
print('Threads limit set to:$threadsLimit');

            

Implementation:

                Future<void> setThreadsLimit(int threadsLimit) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setThreadsLimit', threadsLimit);
}

            

getEncodingCharacterSet #

                Future<String> getEncodingCharacterSet
            

Retrieves the character set used for encoding barcode data

Returns a Future that completes with a String representing the encoding character set.

Example usage:

                String characterSet =await _barkoder.getEncodingCharacterSet;
print('Encoding character set:$characterSet');

            

Implementation:

                Future<String> get getEncodingCharacterSet async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getEncodingCharacterSet');
}

            

getDecodingSpeed #

                Future<DecodingSpeed> getDecodingSpeed
            

Retrieves the current decoding speed setting for barcode scanning

Returns a Future that completes with a DecodingSpeed enum value representing the decoding speed.

Example usage:

                DecodingSpeed speed =await _barkoder.getDecodingSpeed;
print('Decoding speed:$speed');

            

Implementation:

                Future<DecodingSpeed> get getDecodingSpeed async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getDecodingSpeed').then((index) {
    return DecodingSpeed.values[index];
  });
}

            

getFormattingType #

                Future&lt;FormattingType&gt; getFormattingType
            

Retrieves the formatting type used for presenting decoded barcode data.

Returns a Future that completes with a FormattingType enum value representing the formatting type.

Example usage:

                FormattingType type =await _barkoder.getFormattingType;
print('Formatting type:$type');

            

Implementation:

                Future&lt;FormattingType&gt; get getFormattingType async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getFormattingType').then((index) {
    return FormattingType.values[index];
  });
}

            

getVersion #

                Future<String> getVersion
            

Retrieves the version of the Barkoder library.

Returns a Future that completes with a String representing the version of the Barkoder library.

Example usage:

                String version =await _barkoder.getVersion;
print('Barkoder library version:$version');

            

Implementation:

                Future<String> get getVersion async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getVersion');
}

            

getMsiChecksumType #

                Future<MsiChecksumType> getMsiChecksumType
            

Retrieves the MSI checksum type.

Returns a Future that completes with a MsiChecksumType enum value representing the checksum type used for MSI barcodes.

Example usage:

                MsiChecksumType checksumType =await _barkoder.getMsiChecksumType;
print('MSI checksum type:$checksumType');


            

Implementation:

                Future<MsiChecksumType> get getMsiChecksumType async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel
      .invokeMethod('getMsiChecksumType')
      .then((index) {
    return MsiChecksumType.values[index];
  });
}

            

getCode11ChecksumType #

                Future<Code11ChecksumType> getCode11ChecksumType
            

Retrieves the Code11 checksum type.

Returns a Future that completes with a Code11ChecksumType enum value representing the checksum type used for Code11 barcodes.

Example usage:

                Code11ChecksumType checksumType =await _barkoder.getCode11ChecksumType;
print('Code11 checksum type:$checksumType');

            

Implementation:

                Future<Code11ChecksumType> get getCode11ChecksumType async {
    if (_isBarkoderViewNotMounted) {
      return Future.error(PlatformException(
          code: BarkoderErrors.barkoderViewNotMounted,
          message: BarkoderErrors.barkodeViewNotMountedDesc));
    }

    return await _methodChannel
        .invokeMethod('getCode11ChecksumType')
        .then((index) {
      return Code11ChecksumType.values[index];
    });
  }

            

getCode39ChecksumType #

                Future<Code39ChecksumType> getCode39ChecksumType
            

Gets the checksum type for Code 39 barcodes.

Returns a Future that completes with a Code39ChecksumType enum value representing the checksum type used for Code39 barcodes.

Example usage:

                Code39ChecksumType checksumType =await _barkoder.getCode39ChecksumType;
print('Code39 checksum type:$checksumType');

            

Implementation:

                Future<Code39ChecksumType> get getCode39ChecksumType async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel
      .invokeMethod('getCode39ChecksumType')
      .then((index) {
    return Code39ChecksumType.values[index];
  });
}

            

isCloseSessionOnResultEnabled #

                Future<bool> isCloseSessionOnResultEnabled
            

Enables or disables the automatic closing of the scanning session upon detecting a barcode result.

Returns a Future that completes with a boolean indicating whether the session is closed on result enabled.

Example usage:

                bool closeSessionEnabled =await _barkoder.isCloseSessionOnResultEnabled;
print('Close session on result enabled:$closeSessionEnabled');

            

Implementation:

                Future<bool> get isCloseSessionOnResultEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isCloseSessionOnResultEnabled');
}

            

isBeepOnSuccessEnabled #

                Future<bool> isBeepOnSuccessEnabled
            

Gets the value indicating whether a beep sound is played on successful barcode scanning.

Returns a Future that completes with a boolean indicating whether beep on success is enabled.

Example usage:

                bool beepOnSuccessEnabled =await _barkoder.isBeepOnSuccessEnabled;
print('Beep on success enabled:$beepOnSuccessEnabled');


            

Implementation:

                Future<bool> get isBeepOnSuccessEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isBeepOnSuccessEnabled');
}

            

isFlashAvailable() #

                Future<bool> isFlashAvailable()
            

Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning.

Returns a Future that completes with a boolean indicating whether the flash is available.

Example usage:

                bool flashAvailable =await _barkoder.isFlashAvailable();
print('Flash available:$flashAvailable');

            

Implementation:

                Future<bool> isFlashAvailable() {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel
      .invokeMethod('isFlashAvailable')
      .then((isAvailable) => isAvailable as bool);
}

            

isImageResultEnabled #

                Future<bool> isImageResultEnabled
            

Enables or disables the capturing and processing of image data when a barcode is successfully detected.

Returns a Future that completes with a boolean indicating whether image result is enabled.

Example usage:

                bool imageResultEnabled =await _barkoder.isImageResultEnabled;
print('Image result enabled:$imageResultEnabled');

            

Implementation:

                Future<bool> get isImageResultEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isImageResultEnabled');
}

            

isLocationInImageResultEnabled #

                Future<bool> isLocationInImageResultEnabled
            

Enables or disables the inclusion of barcode location information within the image data result.

Returns a Future that completes with a boolean indicating whether location in image result is enabled.

Example usage:

                bool locationInImageResultEnabled =await _barkoder.isLocationInImageResultEnabled;
print('Location in image result enabled:$locationInImageResultEnabled');


            

Implementation:

                Future<bool> get isLocationInImageResultEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isLocationInImageResultEnabled');
}

            

isLocationInPreviewEnabled #

                Future<bool> isLocationInPreviewEnabled
            

Checks if location in preview is enabled.

Returns a Future that completes with a boolean indicating whether location in preview is enabled.

Example usage:

                bool locationInPreviewEnabled =await _barkoder.isLocationInPreviewEnabled;
print('Location in preview enabled:$locationInPreviewEnabled');

            

Implementation:

                Future<bool> get isLocationInPreviewEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isLocationInPreviewEnabled');
}

            

isPinchToZoomEnabled #

                Future<bool> isPinchToZoomEnabled
            

Checks if pinch to zoom is enabled.

Returns a Future that completes with a boolean indicating whether pinch to zoom is enabled.

Example usage:

                bool pinchToZoomEnabled =await _barkoder.isPinchToZoomEnabled;
print('Pinch to zoom enabled:$pinchToZoomEnabled');

            

Implementation:

                Future<bool> get isPinchToZoomEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isPinchToZoomEnabled');
}

            

 isRegionOfInterestVisible #

                Future<bool> isRegionOfInterestVisible
            

Checks if the region of interest (ROI) is visible.

Returns a Future that completes with a boolean indicating whether the ROI is visible.

Example usage:

                bool roiVisible =await _barkoder.isRegionOfInterestVisible;
print('Region of interest visible:$roiVisible');

            

Implementation:

                Future<bool> get isRegionOfInterestVisible async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isRegionOfInterestVisible');
}

            

setFormattingType(FormattingType formattingType) #

                Future<void> setFormattingType(FormattingType formattingType)
            

Sets the formatting type for barcode scanning.

*formattingType: The FormattingType to set.*

Example usage:

                FormattingType type = FormattingType.gs1;
_barkoder.setFormattingType(type);
print('Formatting type set to:$type');


            

Implementation:

                Future<void> setFormattingType(FormattingType formattingType) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setFormattingType', formattingType.index);
}

            

setMsiChecksumType(MsiChecksumType checksumType) #

                Future<void> setMsiChecksumType(MsiChecksumType checksumType)
            

Sets the MSI checksum type.

*checksumType: The MsiChecksumType to set.*

Example usage:

                MsiChecksumType checksumType = MsiChecksumType.mod10;
await _barkoder.setMsiChecksumType(checksumType);
print('MSI checksum type set to:$checksumType');


            

Implementation:

                Future<void> setMsiChecksumType(MsiChecksumType checksumType) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setMsiChecksumType', checksumType.index);
}

            

setCode39ChecksumType(Code39ChecksumType checksumType) #

                Future<void> setCode39ChecksumType(Code39ChecksumType checksumType)
            

Sets the Code39 checksum type.

*checksumType: The Code39ChecksumType to set.*

Example usage:

                Code39ChecksumType checksumType = Code39ChecksumType.enabled;
_barkoder.setCode39ChecksumType(checksumType);
print('Code39 checksum type set to:$checksumType');

            

Implementation:

                Future<void> setCode39ChecksumType(Code39ChecksumType checksumType) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setCode39ChecksumType', checksumType.index);
}

            

setThresholdBetweenDuplicatesScans(int thresholdBetweenDuplicatesScans) #

                Future<void> setThresholdBetweenDuplicatesScans(int thresholdBetweenDuplicatesScans)
            

Sets the threshold between duplicate scans.

*thresholdBetweenDuplicatesScans: An integer representing the threshold in seconds between duplicate scans.*

Example usage:

                int threshold = 1;// 100 milliseconds
_barkoder.setThresholdBetweenDuplicatesScans(threshold);
print('Threshold between duplicate scans set to:$threshold milliseconds');

            

Implementation:

                Future<void> setThresholdBetweenDuplicatesScans(
    int thresholdBetweenDuplicatesScans) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setThresholdBetweenDuplicatesScans', thresholdBetweenDuplicatesScans);
}

            

getThresholdBetweenDuplicatesScans #

                Future<int> getThresholdBetweenDuplicatesScans
            

Retrieves the threshold between duplicate scans.

Returns a Future that completes with an integer representing the threshold between duplicate scans.

Example usage:

                int threshold =await _barkoder.getThresholdBetweenDuplicatesScans;
print('Threshold between duplicate scans:$threshold milliseconds');

            

Implementation:

                Future<int> get getThresholdBetweenDuplicatesScans async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getThresholdBetweenDuplicatesScans');
}

            

setCode11ChecksumType(Code11ChecksumType checksumType) #

                Future<void> setCode11ChecksumType(Code11ChecksumType checksumType)
            

Sets the Code11 checksum type.

*checksumType: The Code11ChecksumType to set.*

Example usage:

                Code11ChecksumType checksumType = Code11ChecksumType.single;
await _barkoder.setCode11ChecksumType(checksumType);
print('Code11 checksum type set to:$checksumType');

            

Implementation:

                Future<void> setCode11ChecksumType(Code11ChecksumType checksumType) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setCode11ChecksumType', checksumType.index);
}

            

isBarcodeTypeEnabled(BarcodeType type) #

                Future<bool> isBarcodeTypeEnabled(BarcodeType type)
            

Checks if a specific barcode type is enabled.

*type: The BarcodeType to check.*

Returns a Future that completes with a boolean indicating whether the specified barcode type is enabled.

Example usage:

                BarcodeType type = BarcodeType.code128;
bool isEnabled =await _barkoder.isBarcodeTypeEnabled(type);
print('Barcode type$type is enabled:$isEnabled');


            

Implementation:

                Future<bool> isBarcodeTypeEnabled(BarcodeType type) async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod(
      'isBarcodeTypeEnabled', type.index);
}

            

setBarcodeTypeEnabled(BarcodeType type, bool enabled) #

                Future<void> setBarcodeTypeEnabled(BarcodeType type, bool enabled)
            

Sets whether a specific barcode type is enabled.

*type: The BarcodeType to enable or disable. enabled: A boolean indicating whether to enable or disable the specified barcode type.*

Example usage:

                BarcodeType type = BarcodeType.code128;
bool isEnabled =true;
_barkoder.setBarcodeTypeEnabled(type, isEnabled);
print('Barcode type$type set to enabled:$isEnabled');


            

Implementation:

                Future<void> setBarcodeTypeEnabled(BarcodeType type, bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setBarcodeTypeEnabled', {'type': type.index, 'enabled': enabled});
}

            

 getBarcodeTypeLengthRange(BarcodeType type) #

                Future<List<int>> getBarcodeTypeLengthRange(BarcodeType type)
            

Retrieves the length range of a specific barcode type.

*type: The BarcodeType to retrieve the length range for.*

Returns a Future that completes with a List representing the minimum and maximum length of the specified barcode type.

Example usage:

                BarcodeType type = BarcodeType.code128;
List<int> lengthRange =await _barkoder.getBarcodeTypeLengthRange(type);
print('Length range of barcode type$type:$lengthRange');


            

Implementation:

                Future<List<int>> getBarcodeTypeLengthRange(BarcodeType type) async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel
      .invokeMethod('getBarcodeTypeLengthRange', type.index)
      .then((value) {
    return List.from(value);
  });
}

            

setBarcodeTypeLengthRange(BarcodeType type, int min, int max) #

                Future<void> setBarcodeTypeLengthRange(BarcodeType type, int min, int max)
            

Sets the length range for the specified barcode type.

*type: The BarcodeType to set the length range for. min: The minimum length for the barcode type. max: The maximum length for the barcode type.*

Example usage:

                BarcodeType type = BarcodeType.code128;
int minLength = 6;
int maxLength = 20;
await _barkoder.setBarcodeTypeLengthRange(type, minLength, maxLength);
print('Length range set for barcode type$type: min=$minLength, max=$maxLength');

            

Implementation:

                Future<void> setBarcodeTypeLengthRange(BarcodeType type, int min, int max) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setBarcodeTypeLengthRange',
      {'type': type.index, 'min': min, 'max': max});
}

            

setMaximumResultsCount(int maximumResultsCount)

                Future<void> setMaximumResultsCount(int maximumResultsCount)
            

Sets the maximum number of results to be returned from barcode scanning.

*maximumResultsCount: The maximum number of results to be returned.*

Example usage:

                int maxResults = 10;
await _barkoder.setMaximumResultsCount(maxResults);
print('Maximum results count set to:$maxResults');

            

Implementation:

                Future<void> setMaximumResultsCount(int maximumResultsCount) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setMaximumResultsCount', maximumResultsCount);
}

            

setMulticodeCachingDuration(int multicodeCachingDuration) #

                Future<void> setMulticodeCachingDuration(int multicodeCachingDuration)
            

Sets the caching duration (in milliseconds) for multi-code results.

*multicodeCachingDuration: An integer representing the multicode caching duration in milliseconds.*

Example usage:

                int cachingDuration = 5000;// 5 secondsawait _barkoder.setMulticodeCachingDuration(cachingDuration);
print('Multicode caching duration set to:$cachingDuration');

            

Implementation:

                Future<void> setMulticodeCachingDuration(int multicodeCachingDuration) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setMulticodeCachingDuration', multicodeCachingDuration);
}

            

setMulticodeCachingEnabled(bool enabled) #

                Future<void> setMulticodeCachingEnabled(bool enabled)
            

Sets whether multi-code caching is enabled.

*enabled: A boolean indicating whether to enable multicode caching.*

Example usage:

                bool multicodeCachingEnabled =true;
await _barkoder.setMulticodeCachingEnabled(multicodeCachingEnabled);
print('Multicode caching enabled:$multicodeCachingEnabled');

            

Implementation:

                Future<void> setMulticodeCachingEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setMulticodeCachingEnabled', enabled);
}

            

getMaximumResultsCount #

                Future<double> getMaximumResultsCount
            

Retrieves the maximum number of results to be returned from barcode scanning at once.

Returns a Future that completes with a double representing the maximum number of results to be returned.

Example usage:

                double maxResults =await _barkoder.getMaximumResultsCount;
print('Maximum results count:$maxResults');


            

Implementation:

                Future<double> get getMaximumResultsCount async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getMaximumResultsCount');
}

            

setDatamatrixDpmModeEnabled(bool enabled) #

                Future<void> setDatamatrixDpmModeEnabled(bool enabled)
            

Sets whether the Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.

Implementation:

                Future<void> setDatamatrixDpmModeEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setDatamatrixDpmModeEnabled', enabled);
}

            

setUpcEanDeblurEnabled(bool enabled) #

                Future<void> setUpcEanDeblurEnabled(bool enabled)
            

Sets whether the deblurring feature for UPC/EAN barcodes is enabled

*enabled: A boolean indicating whether to enable or disable UPC/EAN deblur.*

Example usage:

                bool isEnabled =true;
await _barkoder.setUpcEanDeblurEnabled(isEnabled);
print('UPC/EAN deblur enabled set to:$isEnabled');

            

Implementation:

                Future<void> setUpcEanDeblurEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setUpcEanDeblurEnabled', enabled);
}

            

setEnableMisshaped1DEnabled(bool enabled) #

                Future<void> setEnableMisshaped1DEnabled(bool enabled)
            

Sets whether the detection of misshaped 1D barcodes is enabled

Implementation:

                Future<void> setEnableMisshaped1DEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setEnableMisshaped1DEnabled', enabled);
}

            

setBarcodeThumbnailOnResultEnabled(bool enabled) #

                Future<void> setBarcodeThumbnailOnResultEnabled(bool enabled)
            

Sets whether to enable barcode thumbnail on result.

*enabled: A boolean indicating whether to enable barcode thumbnail on result.*

Example usage:

                bool thumbnailEnabled =true;
await _barkoder.setBarcodeThumbnailOnResultEnabled(thumbnailEnabled);
print('Barcode thumbnail on result enabled:$thumbnailEnabled');

            

Implementation:

                Future<void> setBarcodeThumbnailOnResultEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setBarcodeThumbnailOnResultEnabled', enabled);
}

            

isBarcodeThumbnailOnResultEnabled #

                Future<bool> isBarcodeThumbnailOnResultEnabled
            

Checks if the barcode thumbnail on result is enabled.

Returns a Future that completes with a boolean indicating whether barcode thumbnail on result is enabled.

Example usage:

                bool thumbnailEnabled =await _barkoder.isBarcodeThumbnailOnResultEnabled;
print('Barcode thumbnail on result enabled:$thumbnailEnabled');

            

Implementation:

                Future<bool> get isBarcodeThumbnailOnResultEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isBarcodeThumbnailOnResultEnabled');
}

            

getMulticodeCachingEnabled #

                Future<bool> getMulticodeCachingEnabled
            

Retrieves whether multi-code caching is enabled.

Returns a Future that completes with a boolean indicating whether multicode caching is enabled.

Example usage:

                bool multicodeCachingEnabled =await _barkoder.getMulticodeCachingEnabled;
print('Multicode caching enabled:$multicodeCachingEnabled');

            

Implementation:

                Future<bool> get getMulticodeCachingEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getMulticodeCachingEnabled');
}

            

getMulticodeCachingDuration #

                Future<int> getMulticodeCachingDuration
            

Retrieves the caching duration (in milliseconds) for multi-code results.

Returns a Future that completes with an integer representing the multicode caching duration in milliseconds.

Example usage:

                int cachingDuration =await _barkoder.getMulticodeCachingDuration;
print('Multicode caching duration:$cachingDuration');

            

Implementation:

                Future<int> get getMulticodeCachingDuration async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getMulticodeCachingDuration');
}

            

isUpcEanDeblurEnabled #

                Future<bool> isUpcEanDeblurEnabled
            

Retrieves the value indicating whether deblurring is enabled for UPC/EAN barcodes

Returns a Future that completes with a boolean indicating whether UPC/EAN deblur is enabled.

Example usage:

                bool isEnabled =await _barkoder.isUpcEanDeblurEnabled;
print('UPC/EAN deblur enabled:$isEnabled');


            

Implementation:

                Future<bool> get isUpcEanDeblurEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isUpcEanDeblurEnabled');
}

            

isMisshaped1DEnabled #

                Future<bool> isMisshaped1DEnabled
            

Checks if the detection of misshaped 1D barcodes is enabled.

Returns a Future that completes with a boolean indicating whether misshaped 1D barcodes are enabled.

Example usage:

                bool isEnabled =await _barkoder.isMisshaped1DEnabled;
print('Misshaped 1D barcodes enabled:$isEnabled');


            

Implementation:

                Future<bool> get isMisshaped1DEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isMisshaped1DEnabled');
}

            

isVINRestrictionsEnabled #

                Future<bool> isVINRestrictionsEnabled
            

Checks if VIN restrictions are enabled.

Returns a Future that completes with a boolean indicating whether VIN restrictions are enabled.

Example usage:

                bool isEnabled =await _barkoder.isVINRestrictionsEnabled;
print('VIN restrictions enabled:$isEnabled');


            

Implementation:

                Future<bool> get isVINRestrictionsEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isVINRestrictionsEnabled');
}

            

setEnableVINRestrictions(bool enabled) #

                Future<void> setEnableVINRestrictions(bool enabled)
            

Sets whether Vehicle Identification Number (VIN) restrictions are enabled.

*enabled: A boolean indicating whether to enable or disable VIN restrictions.*

Example usage:

                bool isEnabled =true;
_barkoder.setEnableVINRestrictions(isEnabled);
print('VIN restrictions enabled set to:$isEnabled');


            

Implementation:

                Future<void> setEnableVINRestrictions(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setEnableVINRestrictions', enabled);
}

            

configureBarkoder(BarkoderConfig barkoderConfig) #

                Future<void> configureBarkoder(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));
}

            

getCurrentZoomFactor #

Future getCurrentZoomFactor()

Retrieves the current zoom factor for the device's camera.

Returns a Future that completes with the current zoom factor.

Example usage:

                double currentZoom = await getCurrentZoomFactor();
print('Current zoom factor: $currentZoom');
            

Implementation:

                Future<double> getCurrentZoomFactor() {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel
      .invokeMethod('getCurrentZoomFactor')
      .then((zoomFactor) => zoomFactor as double);
}
            

startCamera #

Future startCamera()

Starts the camera.

Example usage:

                await _barkoder.startCamera();
print('Camera started successfully');
            

Implementation:

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

  return _methodChannel.invokeMethod('startCamera');
}
            

freezeScanning #

Future freezeScanning()

Freezes the current AR scanning session by capturing a still image from the camera feed. Use only when AR mode is enabled to temporarily freeze the view while keeping overlays visible.

Example usage:

                await _barkoder.freezeScanning();
print('Scanning frozen');
            

Implementation:

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

  return _methodChannel.invokeMethod('freezeScanning');
}
            

unfreezeScanning #

Future unfreezeScanning()

Unfreezes the AR scanning session by removing the still image and reactivating the camera and overlays. Use only when AR mode is enabled to restore the live AR view and continue scanning.

Example usage:

                await _barkoder.unfreezeScanning();
print('Scanning unfrozen');
            

Implementation:

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

  return _methodChannel.invokeMethod('unfreezeScanning');
}
            

captureImage #

Future captureImage()

Captures the latest camera frame.

Example usage:

                await _barkoder.captureImage();
print('Image captured');
            

Implementation:

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

  return _methodChannel.invokeMethod('captureImage');
}
            

scanImage #

Future scanImage(void Function(BarkoderResult) resultsCallback, String base64image)

Scan from base64 image string.

Parameters:

  • resultsCallback: A function to handle the scanning results.
  • base64image: The base64 encoded image string to scan.

Example usage:

                _barkoder.scanImage((result) {
  _updateState(result, false);
}, base64ImageString);
print('Scan image called');
            

Implementation:

                Future<void> scanImage(
  void Function(BarkoderResult) resultsCallback,
  String base64image,
) async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  _clearScanningResultsStreamSubscription();
  _scanningResultsStreamSubscription =
      _scanningResultsStream.listen((result) {
    BarkoderResult barkoderResult =
        BarkoderResult.fromJson(json.decode(result));
    resultsCallback(
        barkoderResult); // Pass the BarkoderResult to the callback
  });

  await _methodChannel.invokeMethod('scanImage', base64image);
}
            

onCloseButtonTapped #

void onCloseButtonTapped(VoidCallback handler)

Registers a callback to handle the SDK Close button tap event during scanning (configured via configureCloseButton).

Parameters:

  • handler: Function to execute when the SDK Close button is pressed.

Example usage:

                _barkoder.onCloseButtonTapped(() {
  print('Close button tapped');
});
            

Implementation:

                void onCloseButtonTapped(VoidCallback handler) {
  _uiEventsSubscription?.cancel();
  _uiEventsSubscription = _uiEventsStream.listen((event) {
    if (event == 'closeButtonTapped') {
      handler();
    }
  });
}
            

getLibVersion #

Future getLibVersion

Retrieves the version of the Barkoder library.

Returns a Future that completes with a String representing the version of the Barkoder library.

Example usage:

                String libVersion = await _barkoder.getLibVersion;
print('Barkoder library version: $libVersion');
            

Implementation:

                Future<String> get getLibVersion async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getLibVersion');
}
            

setMisshaped1DEnabled #

Future setMisshaped1DEnabled(bool enabled)

Sets whether the detection of misshaped 1D barcodes is enabled.

Parameters:

  • enabled: A boolean indicating whether to enable or disable misshaped 1D barcodes.

Example usage:

                bool isEnabled = true;
_barkoder.setMisshaped1DEnabled(isEnabled);
print('Misshaped 1D barcodes enabled set to: $isEnabled');
            

Implementation:

                Future<void> setMisshaped1DEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setMisshaped1DEnabled', enabled);
}
            

isDatamatrixDpmModeEnabled #

Future isDatamatrixDpmModeEnabled

Retrieves whether Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.

Returns a Future that completes with a boolean indicating whether Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.

Example usage:

                bool isEnabled = await _barkoder.isDatamatrixDpmModeEnabled;
print('DPM mode for Datamatrix barcodes enabled: $isEnabled');
            

Implementation:

                Future<bool> get isDatamatrixDpmModeEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isDatamatrixDpmModeEnabled');
}
            

isQrDpmModeEnabled #

Future isQrDpmModeEnabled

Retrieves whether Direct Part Marking (DPM) mode for QR barcodes is enabled.

Returns a Future that completes with a boolean indicating whether Direct Part Marking (DPM) mode for QR barcodes is enabled.

Example usage:

                bool isEnabled = await _barkoder.isQrDpmModeEnabled;
print('DPM mode for QR barcodes enabled: $isEnabled');
            

Implementation:

                Future<bool> get isQrDpmModeEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isQrDpmModeEnabled');
}
            

setQrDpmModeEnabled #

Future setQrDpmModeEnabled(bool enabled)

Sets whether the Direct Part Marking (DPM) mode for QR barcodes is enabled.

Parameters:

  • enabled: A boolean indicating whether to enable or disable DPM mode.

Example usage:

                bool isEnabled = true;
_barkoder.setQrDpmModeEnabled(isEnabled);
print('QR DPM mode enabled set to: $isEnabled');
            

Implementation:

                Future<void> setQrDpmModeEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setQrDpmModeEnabled', enabled);
}
            

isQrMultiPartMergeEnabled #

Future isQrMultiPartMergeEnabled

Retrieves whether the QR multi-part merge mode is enabled.

Returns a Future that completes with a boolean indicating whether the QR multi-part merge mode is enabled.

Example usage:

                bool isEnabled = await _barkoder.isQrMultiPartMergeEnabled;
print('QR multi-part merge mode enabled: $isEnabled');
            

Implementation:

                Future<bool> get isQrMultiPartMergeEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isQrMultiPartMergeEnabled');
}
            

setQrMultiPartMergeEnabled #

Future setQrMultiPartMergeEnabled(bool enabled)

Sets whether the QR multi-part merge mode is enabled.

Parameters:

  • enabled: A boolean indicating whether to enable or disable multi-part merge mode.

Example usage:

                bool isEnabled = true;
_barkoder.setQrMultiPartMergeEnabled(isEnabled);
print('QR multi-part merge mode enabled set to: $isEnabled');
            

Implementation:

                Future<void> setQrMultiPartMergeEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setQrMultiPartMergeEnabled', enabled);
}
            

isQrMicroDpmModeEnabled #

Future isQrMicroDpmModeEnabled

Retrieves whether Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.

Returns a Future that completes with a boolean indicating whether Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.

Example usage:

                bool isEnabled = await _barkoder.isQrMicroDpmModeEnabled;
print('DPM mode for QR Micro barcodes enabled: $isEnabled');
            

Implementation:

                Future<bool> get isQrMicroDpmModeEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isQrMicroDpmModeEnabled');
}
            

setQrMicroDpmModeEnabled #

Future setQrMicroDpmModeEnabled(bool enabled)

Sets whether the Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.

Parameters:

  • enabled: A boolean indicating whether to enable or disable DPM mode.

Example usage:

                bool isEnabled = true;
_barkoder.setQrMicroDpmModeEnabled(isEnabled);
print('QR Micro DPM mode enabled set to: $isEnabled');
            

Implementation:

                Future<void> setQrMicroDpmModeEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setQrMicroDpmModeEnabled', enabled);
}
            

isIdDocumentMasterChecksumEnabled #

Future isIdDocumentMasterChecksumEnabled

Retrieves whether Master checksum is enabled when scanning ID Documents.

Returns a Future that completes with a boolean indicating whether Master checksum is enabled when scanning ID Documents.

Example usage:

                bool isEnabled = await _barkoder.isIdDocumentMasterChecksumEnabled;
print('ID Documents master checksum is required(enabled): $isEnabled');
            

Implementation:

                Future<bool> get isIdDocumentMasterChecksumEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel
      .invokeMethod('isIdDocumentMasterChecksumEnabled');
}
            

setIdDocumentMasterChecksumEnabled #

Future setIdDocumentMasterChecksumEnabled(bool enabled)

Sets whether Master checksum should be required when scanning ID Documents.

Parameters:

  • enabled: A boolean indicating whether to enable or disable Master checksum.

Example usage:

                bool isEnabled = true;
_barkoder.setIdDocumentMasterChecksumEnabled(isEnabled);
print('Master checksum enabled set to: $isEnabled');
            

Implementation:

                Future<void> setIdDocumentMasterChecksumEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setIdDocumentMasterChecksumEnabled', enabled);
}
            

setUPCEexpandToUPCA #

Future setUPCEexpandToUPCA(bool enabled)

Sets whether the UPC-E barcodes should be expanded to UPC-A format.

Parameters:

  • enabled: A boolean indicating whether to enable the expansion for UPC-E barcodes.

Example usage:

                bool expandToUPCA = true;
_barkoder.setUPCEexpandToUPCA(expandToUPCA);
print('UPC-E expansion to UPC-A enabled: $expandToUPCA');
            

Implementation:

                Future<void> setUPCEexpandToUPCA(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setUPCEexpandToUPCA', enabled);
}
            

setUPCE1expandToUPCA #

Future setUPCE1expandToUPCA(bool enabled)

Sets whether the UPC-E1 barcodes should be expanded to UPC-A format.

Parameters:

  • enabled: A boolean indicating whether to enable the expansion for UPC-E1 barcodes.

Example usage:

                bool expandToUPCA = true;
_barkoder.setUPCE1expandToUPCA(expandToUPCA);
print('UPC-E1 expansion to UPC-A enabled: $expandToUPCA');
            

Implementation:

                Future<void> setUPCE1expandToUPCA(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setUPCE1expandToUPCA', enabled);
}
            

setCustomOption #

Future setCustomOption(String option, int value)

Setting a custom option.

Parameters:

  • option: A string value for the option key.
  • value: An integer value for the option.

Example usage:

                _barkoder.setCustomOption('optionKey', 1);
print('Custom option set.');
            

Implementation:

                Future<void> setCustomOption(String option, int value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel
      .invokeMethod('setCustomOption', {'option': option, 'value': value});
}
            

getScanningIndicatorColorHex #

Future getScanningIndicatorColorHex

Retrieves the hexadecimal color code representing the line color of the scanning indicator on the camera preview.

Example usage:

                String indicatorColor = await _barkoder.getScanningIndicatorColorHex();
print('Scanning indicator color: $indicatorColor');
            

Implementation:

                Future<String> get getScanningIndicatorColorHex async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getScanningIndicatorColorHex');
}
            

setScanningIndicatorColor #

Future setScanningIndicatorColor(String hexColor)

Sets the color of the lines outlining the scanning indicator for barcode scanning on the camera feed.

Parameters:

  • hexColor: The hexadecimal representation of the color.

Example usage:

                String indicatorColor = '#FF0000'; // Red color
_barkoder.setScanningIndicatorColor(indicatorColor);
print('Scanning indicator color set to: $indicatorColor');
            

Implementation:

                Future<void> setScanningIndicatorColor(String hexColor) async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod(
      'setScanningIndicatorColor', hexColor);
}
            

getScanningIndicatorWidth #

Future getScanningIndicatorWidth

Retrieves the current width setting for the scanning indicator on the camera preview.

Example usage:

                double indicatorWidth = await _barkoder.getScanningIndicatorWidth();
print('Scanning indicator width: $indicatorWidth');
            

Implementation:

                Future<double> get getScanningIndicatorWidth async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getScanningIndicatorWidth');
}
            

setScanningIndicatorWidth #

Future setScanningIndicatorWidth(double lineWidth)

Sets the width of the scanning indicator for barcode scanning on the camera feed.

Parameters:

  • lineWidth: The width of the scanning indicator to set.

Example usage:

                double indicatorWidth = 3.0;
_barkoder.setScanningIndicatorWidth(indicatorWidth);
print('Scanning indicator width set to: $indicatorWidth');
            

Implementation:

                Future<void> setScanningIndicatorWidth(double lineWidth) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setScanningIndicatorWidth', lineWidth);
}
            

getScanningIndicatorAnimation #

Future getScanningIndicatorAnimation

Retrieves the current animation setting for the scanning indicator on the camera preview.

Example usage:

                int animation = await _barkoder.getScanningIndicatorAnimation();
print('Scanning indicator animation: $animation');
            

Implementation:

                Future<int> get getScanningIndicatorAnimation async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('getScanningIndicatorAnimation');
}
            

setScanningIndicatorAnimation #

Future setScanningIndicatorAnimation(int animation)

Sets the animation of the scanning indicator for barcode scanning on the camera feed.

Parameters:

  • animation: The animation of the scanning indicator to set.

Example usage:

                int animation = 1;
_barkoder.setScanningIndicatorAnimation(animation);
print('Scanning indicator animation set to: $animation');
            

Implementation:

                Future<void> setScanningIndicatorAnimation(int animation) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setScanningIndicatorAnimation', animation);
}
            

isScanningIndicatorAlwaysVisible #

Future isScanningIndicatorAlwaysVisible

Retrieves if the scanning indicator is set to be always visible on the camera preview.

Example usage:

                bool alwaysVisible = await _barkoder.isScanningIndicatorAlwaysVisible;
print('Scanning indicator always visible: $alwaysVisible');
            

Implementation:

                Future<bool> get isScanningIndicatorAlwaysVisible async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel
      .invokeMethod('isScanningIndicatorAlwaysVisible');
}
            

setScanningIndicatorAlwaysVisible #

Future setScanningIndicatorAlwaysVisible(bool value)

Sets the scanning indicator to be always shown on the camera feed.

Parameters:

  • value: A boolean indicating whether the scanning indicator should always remain visible.

Example usage:

                bool alwaysVisible = true;
_barkoder.setScanningIndicatorAlwaysVisible(alwaysVisible);
print('Scanning indicator always visible: $alwaysVisible');
            

Implementation:

                Future<void> setScanningIndicatorAlwaysVisible(bool value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setScanningIndicatorAlwaysVisible', value);
}
            

setDynamicExposure #

Future setDynamicExposure(int dynamicExposure)

Sets the camera's exposure dynamically based on the provided intensity, cycling through predefined compensation values.

Parameters:

  • value: The integer value for the exposure intensity.

Example usage:

                int dynamicExposure = 4;
_barkoder.setDynamicExposure(dynamicExposure);
print('Camera dynamic exposure: $dynamicExposure');
            

Implementation:

                Future<void> setDynamicExposure(int dynamicExposure) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setDynamicExposure', dynamicExposure);
}
            

setCentricFocusAndExposure #

Future setCentricFocusAndExposure(bool value)

Sets the camera to use the center of the viewfinder for focus and exposure.

Parameters:

  • value: A boolean indicating whether the center of the viewfinder should be used.

Example usage:

                bool value = true;
_barkoder.setCentricFocusAndExposure(value);
print('Centric focus and exposure: $value');
            

Implementation:

                Future<void> setCentricFocusAndExposure(bool value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setCentricFocusAndExposure', value);
}
            

setEnableComposite #

Future setEnableComposite(int value)

Sets whether Composite Mode should be enabled when scanning.

Parameters:

  • value: The integer value if composite mode should be enabled.

Example usage:

                int value = 1;
_barkoder.setEnableComposite(value);
print('Enable composite: $value');
            

Implementation:

                Future<void> setEnableComposite(int value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setEnableComposite', value);
}
            

setVideoStabilization #

Future setVideoStabilization(bool value)

Enable or disable video stabilization for smoother video capture.

Parameters:

  • value: A boolean indicating whether video stabilization should be enabled/disabled.

Example usage:

                bool value = true;
_barkoder.setVideoStabilization(value);
print('Video stabilization: $value');
            

Implementation:

                Future<void> setVideoStabilization(bool value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setVideoStabilization', value);
}
            

setCamera #

Future setCamera(BarkoderCameraPosition value)

Sets the camera to be used for scanning (back/front).

Parameters:

  • value: The value which camera should be used.

Example usage:

                BarkoderCameraPosition cameraPosition = BarkoderCameraPosition.BACK;
_barkoder.setCamera(cameraPosition);
print('Barkoder camera position set to: $cameraPosition');
            

Implementation:

                Future<void> setCamera(BarkoderCameraPosition value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setCamera', value.index);
}
            

setShowDuplicatesLocations #

Future setShowDuplicatesLocations(bool value)

Enables or disables showing duplicate barcode locations on the preview overlay.

Parameters:

  • value: A boolean indicating whether to show duplicate barcode locations.

Example usage:

                _barkoder.setShowDuplicatesLocations(true);
            

Implementation:

                Future<void> setShowDuplicatesLocations(bool value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setShowDuplicatesLocations', value);
}
            

setARMode #

Future setARMode(BarkoderARMode value)

Sets the AR mode used for barcode scanning visualization.

Parameters:

  • value: The AR mode to set.

Example usage:

                _barkoder.setARMode(BarkoderARMode.interactive);
            

Implementation:

                Future<void> setARMode(BarkoderARMode value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARMode', value.index);
}
            

setARResultDisappearanceDelayMs #

Future setARResultDisappearanceDelayMs(int value)

Sets the delay (in milliseconds) after which a detected AR result is considered expired and removed.

Parameters:

  • value: Delay duration in milliseconds.

Example usage:

                _barkoder.setARResultDisappearanceDelayMs(800);
            

Implementation:

                Future<void> setARResultDisappearanceDelayMs(int value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARResultDisappearanceDelayMs', value);
}
            

setARLocationTransitionSpeed #

Future setARLocationTransitionSpeed(double value)

Sets the speed at which barcode location overlays transition positions.

Parameters:

  • value: The speed value.

Example usage:

                _barkoder.setARLocationTransitionSpeed(0.3);
            

Implementation:

                Future<void> setARLocationTransitionSpeed(double value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARLocationTransitionSpeed', value);
}
            

setAROverlayRefresh #

Future setAROverlayRefresh(BarkoderAROverlayRefresh value)

Sets the refresh mode for the AR overlay on the camera preview.

Parameters:

  • value: The AR overlay refresh mode to set.

Example usage:

                _barkoder.setAROverlayRefresh(BarkoderAROverlayRefresh.smooth);
            

Implementation:

                Future<void> setAROverlayRefresh(BarkoderAROverlayRefresh value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setAROverlayRefresh', value.index);
}
            

setARSelectedLocationColor #

Future setARSelectedLocationColor(String value)

Sets the color used for drawing the overlay around selected barcodes in AR mode.

Parameters:

  • value: The color in hexadecimal format.

Example usage:

                _barkoder.setARSelectedLocationColor('#00FF00');
            

Implementation:

                Future<void> setARSelectedLocationColor(String value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARSelectedLocationColor', value);
}
            

setARNonSelectedLocationColor #

Future setARNonSelectedLocationColor(String value)

Sets the color used for drawing the overlay around non-selected barcodes in AR mode.

Parameters:

  • value: The color in hexadecimal format.

Example usage:

                _barkoder.setARNonSelectedLocationColor('#FF0000');
            

Implementation:

                Future<void> setARNonSelectedLocationColor(String value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARNonSelectedLocationColor', value);
}
            

setARSelectedLocationLineWidth #

Future setARSelectedLocationLineWidth(double value)

Sets the line width of the overlay for selected barcodes in AR mode.

Parameters:

  • value: The width to set.

Example usage:

                _barkoder.setARSelectedLocationLineWidth(2.0);
            

Implementation:

                Future<void> setARSelectedLocationLineWidth(double value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARSelectedLocationLineWidth', value);
}
            

setARNonSelectedLocationLineWidth #

Future setARNonSelectedLocationLineWidth(double value)

Sets the line width of the overlay for non-selected barcodes in AR mode.

Parameters:

  • value: The width to set.

Example usage:

                _barkoder.setARNonSelectedLocationLineWidth(1.0);
            

Implementation:

                Future<void> setARNonSelectedLocationLineWidth(double value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARNonSelectedLocationLineWidth', value);
}
            

setARLocationType #

Future setARLocationType(BarkoderARLocationType value)

Sets the style of location overlays drawn around detected barcodes.

Parameters:

  • value: The location type style to use.

Example usage:

                _barkoder.setARLocationType(BarkoderARLocationType.tight);
            

Implementation:

                Future<void> setARLocationType(BarkoderARLocationType value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARLocationType', value.index);
}
            

setARDoubleTapToFreezeEnabled #

Future setARDoubleTapToFreezeEnabled(bool enabled)

Enables or disables the ability to freeze/unfreeze scanning via double-tap gesture in AR mode.

Parameters:

  • enabled: Whether to enable the double-tap freeze feature.

Example usage:

                _barkoder.setARDoubleTapToFreezeEnabled(true);
            

Implementation:

                Future<void> setARDoubleTapToFreezeEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARDoubleTapToFreezeEnabled', enabled);
}
            

setARImageResultEnabled #

Future setARImageResultEnabled(bool enabled)

Enables or disables the capturing and processing of image data when a barcode is selected for AR mode.

Parameters:

  • enabled: A boolean indicating whether to enable image result.

Example usage:

                bool arImageResultEnabled = true;
_barkoder.setARImageResultEnabled(arImageResultEnabled);
print('AR Image result enabled: $arImageResultEnabled');
            

Implementation:

                Future<void> setARImageResultEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setARImageResultEnabled', enabled);
}
            

setARBarcodeThumbnailOnResultEnabled #

Future setARBarcodeThumbnailOnResultEnabled(bool enabled)

Enables or disables the barcode thumbnail on result for AR mode.

Parameters:

  • enabled: A boolean indicating whether to enable barcode thumbnail on result.

Example usage:

                bool arThumbnailEnabled = true;
_barkoder.setARBarcodeThumbnailOnResultEnabled(arThumbnailEnabled);
print('AR Barcode thumbnail on result enabled: $arThumbnailEnabled');
            

Implementation:

                Future<void> setARBarcodeThumbnailOnResultEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setARBarcodeThumbnailOnResultEnabled', enabled);
}
            

setARResultLimit #

Future setARResultLimit(int value)

Sets the maximum number of results allowed in a single AR scanning session.

Parameters:

  • value: The maximum number of results.

Example usage:

                _barkoder.setARResultLimit(5);
            

Implementation:

                Future<void> setARResultLimit(int value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARResultLimit', value);
}
            

setARContinueScanningOnLimit #

Future setARContinueScanningOnLimit(bool value)

Sets whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).

Parameters:

  • value: A boolean indicating whether to continue scanning.

Example usage:

                _barkoder.setARContinueScanningOnLimit(true);
            

Implementation:

                Future<void> setARContinueScanningOnLimit(bool value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARContinueScanningOnLimit', value);
}
            

setAREmitResultsAtSessionEndOnly #

Future setAREmitResultsAtSessionEndOnly(bool value)

Sets whether results are emitted only at AR session end (or when the limit is reached).

Parameters:

  • value: A boolean indicating whether results are emitted only at the end of the session.

Example usage:

                _barkoder.setAREmitResultsAtSessionEndOnly(true);
            

Implementation:

                Future<void> setAREmitResultsAtSessionEndOnly(bool value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setAREmitResultsAtSessionEndOnly', value);
}
            

setARHeaderHeight #

Future setARHeaderHeight(double value)

Sets the height of the header text label shown above the barcode in AR mode.

Parameters:

  • value: Header height.

Example usage:

                _barkoder.setARHeaderHeight(24.0);
            

Implementation:

                Future<void> setARHeaderHeight(double value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderHeight', value);
}
            

setARHeaderShowMode #

Future setARHeaderShowMode(BarkoderARHeaderShowMode value)

Sets the condition under which the header text is shown above the barcode.

Parameters:

  • value: The display mode for the AR header.

Example usage:

                _barkoder.setARHeaderShowMode(BarkoderARHeaderShowMode.onSelected);
            

Implementation:

                Future<void> setARHeaderShowMode(BarkoderARHeaderShowMode value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderShowMode', value.index);
}
            

setARHeaderMaxTextHeight #

Future setARHeaderMaxTextHeight(double value)

Sets the maximum text height used for rendering AR header text.

Parameters:

  • value: Maximum height.

Example usage:

                _barkoder.setARHeaderMaxTextHeight(22.0);
            

Implementation:

                Future<void> setARHeaderMaxTextHeight(double value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderMaxTextHeight', value);
}
            

setARHeaderMinTextHeight #

Future setARHeaderMinTextHeight(double value)

Sets the minimum text height used for rendering AR header text.

Parameters:

  • value: Minimum height.

Example usage:

                _barkoder.setARHeaderMinTextHeight(12.0);
            

Implementation:

                Future<void> setARHeaderMinTextHeight(double value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderMinTextHeight', value);
}
            

setARHeaderTextColorSelected #

Future setARHeaderTextColorSelected(String value)

Sets the text color of the header when the barcode is in a selected state.

Parameters:

  • value: The color in hexadecimal format.

Example usage:

                _barkoder.setARHeaderTextColorSelected('#FFFFFF');
            

Implementation:

                Future<void> setARHeaderTextColorSelected(String value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderTextColorSelected', value);
}
            

setARHeaderTextColorNonSelected #

Future setARHeaderTextColorNonSelected(String value)

Sets the text color of the header when the barcode is not selected.

Parameters:

  • value: The color in hexadecimal format.

Example usage:

                _barkoder.setARHeaderTextColorNonSelected('#AAAAAA');
            

Implementation:

                Future<void> setARHeaderTextColorNonSelected(String value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderTextColorNonSelected', value);
}
            

setARHeaderHorizontalTextMargin #

Future setARHeaderHorizontalTextMargin(double value)

Sets the horizontal margin applied to the header text in AR mode, creating equal padding on both sides.

Parameters:

  • value: Horizontal margin.

Example usage:

                _barkoder.setARHeaderHorizontalTextMargin(8.0);
            

Implementation:

                Future<void> setARHeaderHorizontalTextMargin(double value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderHorizontalTextMargin', value);
}
            

setARHeaderVerticalTextMargin #

Future setARHeaderVerticalTextMargin(double value)

Sets the vertical margin applied to the header text in AR mode, creating equal padding on both sides.

Parameters:

  • value: Vertical margin.

Example usage:

                _barkoder.setARHeaderVerticalTextMargin(4.0);
            

Implementation:

                Future<void> setARHeaderVerticalTextMargin(double value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderVerticalTextMargin', value);
}
            

setARHeaderTextFormat #

Future setARHeaderTextFormat(String value)

Sets the format string for the AR header text above each barcode.

Parameters:

  • value: Format string with placeholders (e.g., [barcode_text]).

Example usage:

                _barkoder.setARHeaderTextFormat('[barcode_text] - [barcode_type]');
            

Implementation:

                Future<void> setARHeaderTextFormat(String value) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('setARHeaderTextFormat', value);
}
            

configureCloseButton #

Future configureCloseButton({...})

Configures the close button displayed during scanning. All color strings are hex (e.g., "#3472c9"), and icon strings are Base64.

Parameters:

  • visible: Show the button while scanning.
  • positionX: X position in points.
  • positionY: Y position in points.
  • iconSize: Glyph point size.
  • tintColor: Icon tint as a hex string; leave "" to use the default.
  • backgroundColor: Button background as a hex string; leave "" for default (clear).
  • cornerRadius: Corner radius.
  • padding: Inner padding around the glyph.
  • useCustomIcon: Set true to use the provided custom icon.
  • customIcon: Custom icon as a Base64-encoded image string.

Implementation:

                Future<void> configureCloseButton({
  required bool visible,
  required double positionX,
  required double positionY,
  required double iconSize,
  required String tintColor,
  required String backgroundColor,
  required double cornerRadius,
  required double padding,
  required bool useCustomIcon,
  required String customIcon, // base64 string
}) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('configureCloseButton', {
    'visible': visible,
    'positionX': positionX,
    'positionY': positionY,
    'iconSize': iconSize,
    'tintColor': tintColor,
    'backgroundColor': backgroundColor,
    'cornerRadius': cornerRadius,
    'padding': padding,
    'useCustomIcon': useCustomIcon,
    'customIcon': customIcon,
  });
}
            

configureFlashButton #

Future configureFlashButton({...})

Configures the flash (torch) button displayed during scanning; auto-hides if the device torch is unavailable. All color strings are hex (e.g., "#3472c9"), and icon strings are Base64.

Parameters:

  • visible: Show the button while scanning.
  • positionX: X position in points.
  • positionY: Y position in points.
  • iconSize: Glyph point size.
  • tintColor: Icon tint as a hex string; leave "" to use the default.
  • backgroundColor: Button background as a hex string; leave "" for default (clear).
  • cornerRadius: Corner radius.
  • padding: Inner padding around the glyph.
  • useCustomIcon: Set true to use the provided custom icons.
  • customIconFlashOn: ON-state icon as a Base64-encoded image string.
  • customIconFlashOff: OFF-state icon as a Base64-encoded image string.

Implementation:

                Future<void> configureFlashButton({
  required bool visible,
  required double positionX,
  required double positionY,
  required double iconSize,
  required String tintColor,
  required String backgroundColor,
  required double cornerRadius,
  required double padding,
  required bool useCustomIcon,
  required String customIconFlashOn,  // base64
  required String customIconFlashOff, // base64
}) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('configureFlashButton', {
    'visible': visible,
    'positionX': positionX,
    'positionY': positionY,
    'iconSize': iconSize,
    'tintColor': tintColor,
    'backgroundColor': backgroundColor,
    'cornerRadius': cornerRadius,
    'padding': padding,
    'useCustomIcon': useCustomIcon,
    'customIconFlashOn': customIconFlashOn,
    'customIconFlashOff': customIconFlashOff,
  });
}
            

configureZoomButton #

Future configureZoomButton({...})

Configures the zoom button displayed during scanning. All color strings are hex (e.g., "#3472c9"), and icon strings are Base64.

Parameters:

  • visible: Show the button while scanning.
  • positionX: X position in points.
  • positionY: Y position in points.
  • iconSize: Glyph point size.
  • tintColor: Icon tint as a hex string; leave "" to use the default.
  • backgroundColor: Button background as a hex string; leave "" for default (clear).
  • cornerRadius: Corner radius.
  • padding: Inner padding around the glyph.
  • useCustomIcon: Set true to use the provided custom icons.
  • customIconZoomedIn: Zoomed-in state icon as a Base64-encoded image string.
  • customIconZoomedOut: Zoomed-out state icon as a Base64-encoded image string.
  • zoomedInFactor: Zoom factor to apply when toggled in (e.g., 2.0).
  • zoomedOutFactor: Zoom factor to apply when toggled out (e.g., 1.0).

Implementation:

                Future<void> configureZoomButton({
  required bool visible,
  required double positionX,
  required double positionY,
  required double iconSize,
  required String tintColor,
  required String backgroundColor,
  required double cornerRadius,
  required double padding,
  required bool useCustomIcon,
  required String customIconZoomedIn,   // base64
  required String customIconZoomedOut,  // base64
  required double zoomedInFactor,
  required double zoomedOutFactor,
}) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return _methodChannel.invokeMethod('configureZoomButton', {
    'visible': visible,
    'positionX': positionX,
    'positionY': positionY,
    'iconSize': iconSize,
    'tintColor': tintColor,
    'backgroundColor': backgroundColor,
    'cornerRadius': cornerRadius,
    'padding': padding,
    'useCustomIcon': useCustomIcon,
    'customIconZoomedIn': customIconZoomedIn,
    'customIconZoomedOut': customIconZoomedOut,
    'zoomedInFactor': zoomedInFactor,
    'zoomedOutFactor': zoomedOutFactor,
  });
}
            

selectVisibleBarcodes #

Future selectVisibleBarcodes()

Selects all barcodes that are currently visible in AR mode.

Example usage:

                _barkoder.selectVisibleBarcodes();
print('Selected visible barcodes');
            

Implementation:

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

  return _methodChannel.invokeMethod('selectVisibleBarcodes');
}
            

getShowDuplicatesLocations #

Future getShowDuplicatesLocations()

Retrieves whether showing duplicate barcode locations in the AR view is enabled.

Returns a Future that completes with a bool value.

Example usage:

                bool showDuplicates = await _barkoder.getShowDuplicatesLocations();
print('Show duplicates locations: $showDuplicates');
            

Implementation:

                Future<bool> getShowDuplicatesLocations() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getShowDuplicatesLocations');
}
            

getARMode #

Future getARMode()

Retrieves the current AR mode used for barcode scanning.

Returns a Future that completes with a BarkoderARMode value.

Example usage:

                BarkoderARMode mode = await _barkoder.getARMode();
print('Current AR Mode: $mode');
            

Implementation:

                Future<BarkoderARMode> getARMode() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  final index = await _methodChannel.invokeMethod('getARMode');
  return BarkoderARMode.values[index];
}
            

getARResultDisappearanceDelayMs #

Future getARResultDisappearanceDelayMs()

Retrieves the delay after which AR results disappear once detected.

Returns a Future that completes with an int value.

Example usage:

                int delay = await _barkoder.getARResultDisappearanceDelayMs();
print('AR result disappearance delay: $delay ms');
            

Implementation:

                Future<int> getARResultDisappearanceDelayMs() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARResultDisappearanceDelayMs');
}
            

getARLocationTransitionSpeed #

Future getARLocationTransitionSpeed()

Retrieves the transition speed for AR barcode location overlays.

Returns a Future that completes with a double value.

Example usage:

                double speed = await _barkoder.getARLocationTransitionSpeed();
print('AR transition speed: $speed');
            

Implementation:

                Future<double> getARLocationTransitionSpeed() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARLocationTransitionSpeed');
}
            

getAROverlayRefresh #

Future getAROverlayRefresh()

Retrieves the AR overlay refresh mode.

Returns a Future that completes with a BarkoderAROverlayRefresh enum value.

Example usage:

                var mode = await _barkoder.getAROverlayRefresh();
print('AR overlay refresh mode: $mode');
            

Implementation:

                Future<BarkoderAROverlayRefresh> getAROverlayRefresh() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  final index = await _methodChannel.invokeMethod('getAROverlayRefresh');
  return BarkoderAROverlayRefresh.values[index];
}
            

getARSelectedLocationColor #

Future getARSelectedLocationColor()

Retrieves the color used for selected barcode overlays in AR mode.

Returns a Future that completes with a String hex color.

Example usage:

                String color = await _barkoder.getARSelectedLocationColor();
print('Selected location color: $color');
            

Implementation:

                Future<String> getARSelectedLocationColor() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARSelectedLocationColor');
}
            

getARNonSelectedLocationColor #

Future getARNonSelectedLocationColor()

Retrieves the color used for non-selected barcode overlays in AR mode.

Returns a Future that completes with a String hex color.

Example usage:

                String color = await _barkoder.getARNonSelectedLocationColor();
print('Non-selected location color: $color');
            

Implementation:

                Future<String> getARNonSelectedLocationColor() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARNonSelectedLocationColor');
}
            

getARSelectedLocationLineWidth #

Future getARSelectedLocationLineWidth()

Retrieves the line width for selected barcode overlays in AR mode.

Returns a Future that completes with a double value.

Example usage:

                double width = await _barkoder.getARSelectedLocationLineWidth();
print('Selected line width: $width');
            

Implementation:

                Future<double> getARSelectedLocationLineWidth() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARSelectedLocationLineWidth');
}
            

getARNonSelectedLocationLineWidth #

Future getARNonSelectedLocationLineWidth()

Retrieves the line width for non-selected barcode overlays in AR mode.

Returns a Future that completes with a double value.

Example usage:

                double width = await _barkoder.getARNonSelectedLocationLineWidth();
print('Non-selected line width: $width');
            

Implementation:

                Future<double> getARNonSelectedLocationLineWidth() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARNonSelectedLocationLineWidth');
}
            

getARLocationType #

Future getARLocationType()

Retrieves the style of AR location overlays (tight, bounding box, none).

Returns a Future that completes with a BarkoderARLocationType value.

Example usage:

                var type = await _barkoder.getARLocationType();
print('AR location type: $type');
            

Implementation:

                Future<BarkoderARLocationType> getARLocationType() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  final index = await _methodChannel.invokeMethod('getARLocationType');
  return BarkoderARLocationType.values[index];
}
            

isARDoubleTapToFreezeEnabled #

Future isARDoubleTapToFreezeEnabled()

Checks whether double-tap to freeze is enabled in AR mode.

Returns a Future that completes with a bool value.

Example usage:

                bool enabled = await _barkoder.isARDoubleTapToFreezeEnabled();
print('Double tap to freeze: $enabled');
            

Implementation:

                Future<bool> isARDoubleTapToFreezeEnabled() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('isARDoubleTapToFreezeEnabled');
}
            

isARImageResultEnabled #

Future isARImageResultEnabled

Retrieves whether image result is enabled for AR mode.

Returns a Future that completes with a boolean indicating whether image result is enabled.

Example usage:

                bool arImageResultEnabled = await _barkoder.isARImageResultEnabled;
print('AR Image result enabled: $arImageResultEnabled');
            

Implementation:

                Future<bool> get isARImageResultEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel.invokeMethod('isARImageResultEnabled');
}
            

isARBarcodeThumbnailOnResultEnabled #

Future isARBarcodeThumbnailOnResultEnabled

Retrieves whether barcode thumbnail on result is enabled for AR mode.

Returns a Future that completes with a boolean indicating whether barcode thumbnail on result is enabled.

Example usage:

                bool arThumbnailEnabled = await _barkoder.isARBarcodeThumbnailOnResultEnabled;
print('AR Barcode thumbnail on result enabled: $arThumbnailEnabled');
            

Implementation:

                Future<bool> get isARBarcodeThumbnailOnResultEnabled async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return await _methodChannel
      .invokeMethod('isARBarcodeThumbnailOnResultEnabled');
}
            

getARResultLimit #

Future getARResultLimit

Retrieves the maximum number of results allowed in a single AR scanning session.

Example usage:

                int resultLimit = await _barkoder.getARResultLimit;
            

Implementation:

                Future<int> get getARResultLimit async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return await _methodChannel.invokeMethod('getARResultLimit');
}
            

getARContinueScanningOnLimit #

Future getARContinueScanningOnLimit

Retrieves whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).

Example usage:

                bool continueScanning = await _barkoder.getARContinueScanningOnLimit;
            

Implementation:

                Future<bool> get getARContinueScanningOnLimit async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return await _methodChannel.invokeMethod('getARContinueScanningOnLimit');
}
            

getAREmitResultsAtSessionEndOnly #

Future getAREmitResultsAtSessionEndOnly

Retrieves whether results are emitted only at AR session end (or when the limit is reached).

Example usage:

                bool emitAtEnd = await _barkoder.getAREmitResultsAtSessionEndOnly;
            

Implementation:

                Future<bool> get getAREmitResultsAtSessionEndOnly async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc,
    ));
  }

  return await _methodChannel.invokeMethod('getAREmitResultsAtSessionEndOnly');
}
            

getARHeaderHeight #

Future getARHeaderHeight()

Retrieves the header height above barcode in AR mode.

Returns a Future that completes with a double value.

Example usage:

                double height = await _barkoder.getARHeaderHeight();
print('AR header height: $height');
            

Implementation:

                Future<double> getARHeaderHeight() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARHeaderHeight');
}
            

getARHeaderShowMode #

Future getARHeaderShowMode()

Retrieves the header display mode (always, on selected, never).

Returns a Future that completes with a BarkoderARHeaderShowMode value.

Example usage:

                var mode = await _barkoder.getARHeaderShowMode();
print('AR header show mode: $mode');
            

Implementation:

                Future<BarkoderARHeaderShowMode> getARHeaderShowMode() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  final index = await _methodChannel.invokeMethod('getARHeaderShowMode');
  return BarkoderARHeaderShowMode.values[index];
}
            

getARHeaderMaxTextHeight #

Future getARHeaderMaxTextHeight()

Retrieves the maximum text height for AR headers.

Returns a Future that completes with a double value.

Example usage:

                double maxHeight = await _barkoder.getARHeaderMaxTextHeight();
print('Max text height: $maxHeight');
            

Implementation:

                Future<double> getARHeaderMaxTextHeight() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARHeaderMaxTextHeight');
}
            

getARHeaderMinTextHeight #

Future getARHeaderMinTextHeight()

Retrieves the minimum text height for AR headers.

Returns a Future that completes with a double value.

Example usage:

                double minHeight = await _barkoder.getARHeaderMinTextHeight();
print('Min text height: $minHeight');
            

Implementation:

                Future<double> getARHeaderMinTextHeight() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARHeaderMinTextHeight');
}
            

getARHeaderTextColorSelected #

Future getARHeaderTextColorSelected()

Retrieves the header text color for selected barcodes.

Returns a Future that completes with a String hex color.

Example usage:

                String color = await _barkoder.getARHeaderTextColorSelected();
print('Header selected text color: $color');
            

Implementation:

                Future<String> getARHeaderTextColorSelected() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARHeaderTextColorSelected');
}
            

getARHeaderTextColorNonSelected #

Future getARHeaderTextColorNonSelected()

Retrieves the header text color for non-selected barcodes.

Returns a Future that completes with a String hex color.

Example usage:

                String color = await _barkoder.getARHeaderTextColorNonSelected();
print('Header non-selected text color: $color');
            

Implementation:

                Future<String> getARHeaderTextColorNonSelected() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARHeaderTextColorNonSelected');
}
            

getARHeaderHorizontalTextMargin #

Future getARHeaderHorizontalTextMargin()

Retrieves the horizontal margin for AR header text.

Returns a Future that completes with a double value.

Example usage:

                double margin = await _barkoder.getARHeaderHorizontalTextMargin();
print('Header horizontal margin: $margin');
            

Implementation:

                Future<double> getARHeaderHorizontalTextMargin() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARHeaderHorizontalTextMargin');
}
            

getARHeaderVerticalTextMargin #

Future getARHeaderVerticalTextMargin()

Retrieves the vertical margin for AR header text.

Returns a Future that completes with a double value.

Example usage:

                double margin = await _barkoder.getARHeaderVerticalTextMargin();
print('Header vertical margin: $margin');
            

Implementation:

                Future<double> getARHeaderVerticalTextMargin() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARHeaderVerticalTextMargin');
}
            

getARHeaderTextFormat #

Future getARHeaderTextFormat()

Retrieves the format string used for AR header text.

Returns a Future that completes with a String value.

Example usage:

                String format = await _barkoder.getARHeaderTextFormat();
print('Header text format: $format');
            

Implementation:

                Future<String> getARHeaderTextFormat() async {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
      code: BarkoderErrors.barkoderViewNotMounted,
      message: BarkoderErrors.barkodeViewNotMountedDesc));
  }
  return await _methodChannel.invokeMethod('getARHeaderTextFormat');
}
            


barkoder.com | https://barkoder.com/docs/v1/home

Page Contents