toMap method

Map<String, dynamic> toMap()

Converts the SunmiQrcodeStyle object to a map for easy transfer or serialization.

The returned map contains the properties of the QR code style, which can be used to send the configuration to the printer or another system.

Returns a map with:

  • 'qrcodeSize': The size of the QR code.
  • 'errorLevel': The error correction level for the QR code.
  • 'align': The alignment of the QR code.

Implementation

Map<String, dynamic> toMap() {
  return <String, dynamic>{
    'qrcodeSize': qrcodeSize, // The size of the QR code.
    'errorLevel': errorLevel
        .name, // The error correction level (string representation).
    'align': align.name, // The alignment (string representation).
  };
}