setBarcodeTypeLengthRange method

Future<void> setBarcodeTypeLengthRange(
  1. BarcodeType type,
  2. int min,
  3. 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});
}