mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

How can i show only use full value from raw data

Open kingkarki opened this issue 1 year ago • 1 comments

How can i show my use full value form this raw data

this is my after scanned raw data

BEGIN:VCARD VERSION:3.0 N:Ghataney;Samir;Samir sunar;Mr;Ghataney FN:Mr Samir Samir sunar Ghataney Ghataney ORG:Thenextcoders TITLE:FLutter Frontend developer TEL;TYPE=WORK:1121212121313 TEL;TYPE=CELL:321321321321 TEL;TYPE=WORK,FAX:1321321 EMAIL;TYPE=INTERNET,WORK:[email protected] ADR;TYPE=WORK:;;Surkhet Birendra nagar khorkeline ;Birendra nagar ;surkhet ;1321;nepal URL;TYPE=WORK:https://www.qrstuff.com/type/contact-detail NOTE:Test

this is my code

` SizedBox( child: MobileScanner( controller: cameraController, overlay: Container( width: 200, height: 200, padding: const EdgeInsets.symmetric(horizontal: 0), child: Image.asset('assets/images/frame-3.png'), ), onDetect: ( capture, ) { if (!isScanCompleted) { final dynamic values = capture.barcodes .map((code) => code.rawValue ?? '---') .toList()[0];

                // final dynamic values;
                final Uint8List? imageBytes = capture.image;
                // final format =
                //     capture.barcodes[0].format; // Access the format here

                // final type =
                //     capture.barcodes[0].type; // Access the type here

                // debugPrint(
                //     'Barcode found! ${values} (format: ${format}) (type: $type)');

                // debugPrint('🔴 ,${values}');
                isScanCompleted = true;

                Navigator.of(context).push(
                  MaterialPageRoute(
                    builder: (context) => ResultPage(
                      code: values,
                      closeScreen: closeScreen,
                      imageBytes: imageBytes,
                    ),
                  ),
                );
              }
            },
          ),
        )`

image

kingkarki avatar Jan 07 '24 04:01 kingkarki

You could try to get the properties from the Barcode, there are some getters available. Alternatively, you could try parsing the rawValue of the Barcode.

navaronbracke avatar Jan 08 '24 14:01 navaronbracke