class QRValidacion { static final RegExp _regExp = RegExp(r'^(SUPER)%([\w\s\-]*)%([\w\s\-]*)%(GAS)$'); static Map validarQR(String qrCode) { final RegExpMatch? match = _regExp.firstMatch(qrCode); if (match != null) { return { 'isValid': 'true', 'idEmpresa': match.group(2), 'numeroUnidad': match.group(3), }; } else { return { 'isValid': 'false', 'idEmpresa': 'Desconocido', 'numeroUnidad': 'Desconocido', }; } } }