isBarcodeTypeEnabled method

Future<bool> isBarcodeTypeEnabled(
  1. 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);
}