decodeFormatInformation static method

FormatInformation? decodeFormatInformation(
  1. int maskedFormatInfo1,
  2. int maskedFormatInfo2
)

@param maskedFormatInfo1 format info indicator, with mask still applied @param maskedFormatInfo2 second copy of same info; both are checked at the same time to establish best match @return information about the format it specifies, or null if doesn't seem to match any known pattern

Implementation

static FormatInformation? decodeFormatInformation(
  int maskedFormatInfo1,
  int maskedFormatInfo2,
) {
  final formatInfo =
      _doDecodeFormatInformation(maskedFormatInfo1, maskedFormatInfo2);
  if (formatInfo != null) {
    return formatInfo;
  }
  // Should return null, but, some QR codes apparently
  // do not mask this info. Try again by actually masking the pattern
  // first
  return _doDecodeFormatInformation(
    maskedFormatInfo1 ^ _formatInfoMaskQr,
    maskedFormatInfo2 ^ _formatInfoMaskQr,
  );
}