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<FormattingType> 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<FormattingType> 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');
}
isRegionOfInterestVisible #
Future<bool> isRegionOfInterestVisible
Retrieves the value indicating whether vibration is enabled on successful barcode scanning.
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);
}
setDuplicatesDelayMs(int duplicatesDelayMs) #
Future<void> setDuplicatesDelayMs(int duplicatesDelayMs)
Sets the delay in milliseconds for considering duplicate barcodes during scanning.
*duplicatesDelayMs
: The delay in milliseconds for detecting duplicate scans.*
Example usage:
int delayMs = 500;// 500 milliseconds
_barkoder.setDuplicatesDelayMs(delayMs);
print('Duplicates detection delay set to:$delayMs milliseconds');
Implementation:
Future<void> setDuplicatesDelayMs(int duplicatesDelayMs) {
if (_isBarkoderViewNotMounted) {
return Future.error(PlatformException(
code: BarkoderErrors.barkoderViewNotMounted,
message: BarkoderErrors.barkodeViewNotMountedDesc));
}
return _methodChannel.invokeMethod(
'setDuplicatesDelayMs', duplicatesDelayMs);
}
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');
}
getDuplicatesDelayMs #
Future<int> getDuplicatesDelayMs
Gets the delay in milliseconds for considering duplicate barcodes during scanning.
Returns a Future that completes with an integer representing the delay in milliseconds for detecting duplicate scans.
Example usage:
int delayMs =await _barkoder.getDuplicatesDelayMs;
print('Duplicates detection delay:$delayMs milliseconds');
Implementation:
Future<int> get getDuplicatesDelayMs async {
if (_isBarkoderViewNotMounted) {
return Future.error(PlatformException(
code: BarkoderErrors.barkoderViewNotMounted,
message: BarkoderErrors.barkodeViewNotMountedDesc));
}
return await _methodChannel.invokeMethod('getDuplicatesDelayMs');
}
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));
}