buildQR function

Widget buildQR(
  1. Context context,
  2. String url,
  3. double? height,
  4. double? width,
)

Implementation

pw.Widget buildQR(pw.Context context, String url, double? height, double? width) {
  return url.trim().isNotEmpty
    ? pw.BarcodeWidget(
      data: url,
      width: width ?? 80,
      height: height ?? 80,
      barcode: pw.Barcode.qrCode(),
      drawText: false,
    ) : pw.SizedBox(width: width ?? 80);
}