getBarcodeTypeLengthRange method

Future<List<int>> getBarcodeTypeLengthRange(
  1. 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);
  });
}