buildTestQrPng function

Uint8List buildTestQrPng(
  1. String payload, {
  2. int moduleSize = 4,
  3. int quietZone = 4,
})

Renders payload as a QR code PNG (EC level L, like real cards), for feeding decodeImage or a mocked image picker in tests.

The text is stored as one UTF-8 byte segment without an ECI header, the way card QR codes are.

Implementation

Uint8List buildTestQrPng(
  String payload, {
  int moduleSize = 4,
  int quietZone = 4,
}) =>
    img.encodePng(
      renderTestQr(payload, moduleSize: moduleSize, quietZone: quietZone),
    );