setFormattingType method

Future<void> setFormattingType(
  1. 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);
}