isValidQRData static method

bool isValidQRData(
  1. String data
)

Validates if a string can be encoded as QR code

Implementation

static bool isValidQRData(String data) {
  if (data.isEmpty) return false;

  // Check if data is not too long for QR code
  // QR codes have different capacity limits based on version and error correction
  return data.length <=
      2953; // Approximate limit for version 40 with M error correction
}