1234567891011121314151617181920212223 |
- class QRValidacion {
- static final RegExp _regExp =
- RegExp(r'^(SUPER)%([\w\s\-]*)%([\w\s\-]*)%(GAS)$');
- static Map<String, String?> 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',
- };
- }
- }
- }
|