Encoder class

@author satorux@google.com (Satoru Takabayashi) - creator @author dswitkin@google.com (Daniel Switkin) - ported from C++

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

defaultByteModeEncoding CharacterSetECI
final

Static Methods

append8BitBytes(String content, BitArray bits, Encoding encoding) → void
appendAlphanumericBytes(String content, BitArray bits) → void
appendBytes(String content, Mode mode, BitArray bits, CharacterSetECI encoding) → void
Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits".
appendKanjiBytes(String content, BitArray bits) → void
appendLengthInfo(int numLetters, Version version, Mode mode, BitArray bits) → void
Append length info. On success, store the result in "bits".
appendModeInfo(Mode mode, BitArray bits) → void
Append mode info. On success, store the result in "bits".
appendNumericBytes(String content, BitArray bits) → void
chooseMode(String content, {CharacterSetECI? encoding}) → Mode
Choose the best mode by examining the content. Note that 'encoding' is used as a hint; if it is Shift_JIS, and the input is only double-byte Kanji, then we return {@link Mode#KANJI}.
encode(String content, ErrorCorrectionLevel ecLevel, {EncodeHints? hints}) QRCode
@param content text to encode @param ecLevel error correction level to use @return {@link QRCode} representing the encoded QR code @throws WriterException if encoding can't succeed, because of for example invalid content or configuration
generateECBytes(Int8List dataBytes, int numEcBytesInBlock) Int8List
getAlphanumericCode(int code) int
@return the code point of the table used in alphanumeric mode or -1 if there is no corresponding code in the table.
getNumDataBytesAndNumECBytesForBlockID(int numTotalBytes, int numDataBytes, int numRSBlocks, int blockID, Int32List numDataBytesInBlock, Int32List numECBytesInBlock) → void
Get number of data bytes and number of error correction bytes for block id "blockID". Store the result in "numDataBytesInBlock", and "numECBytesInBlock". See table 12 in 8.5.1 of JISX0510:2004 (p.30)
interleaveWithECBytes(BitArray bits, int numTotalBytes, int numDataBytes, int numRSBlocks) → BitArray
Interleave "bits" with corresponding error correction bytes. On success, store the result in "result". The interleave rule is complicated. See 8.6 of JISX0510:2004 (p.37) for details.
terminateBits(int numDataBytes, BitArray bits) → void
Terminate bits as described in 8.4.8 and 8.4.9 of JISX0510:2004 (p.24).