encode static method

AztecCode encode(
  1. String data, [
  2. int minECCPercent = defaultAztecLayers,
  3. int userSpecifiedLayers = defaultAztecLayers,
  4. Encoding? charset,
])

Encodes the given string content as an Aztec symbol

@param data input data string @param minECCPercent minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended) @param userSpecifiedLayers if non-zero, a user-specified value for the number of layers @param charset character set in which to encode string using ECI; if null, no ECI code will be inserted, and the string must be encodable as ISO/IEC 8859-1 (Latin-1), the default encoding of the symbol. @return Aztec symbol matrix with metadata

Implementation

static AztecCode encode(
  String data, [
  int minECCPercent = defaultAztecLayers,
  int userSpecifiedLayers = defaultAztecLayers,
  Encoding? charset,
]) {
  final List<int> bytes = (charset ?? latin1).encode(data);
  return encodeData(
    Uint8List.fromList(bytes),
    minECCPercent,
    userSpecifiedLayers,
    charset,
  );
}