mintware-de / flutter_barcode_reader

A flutter plugin for reading 2D barcodes and QR codes.
MIT License
628 stars 463 forks source link

I cannot compare the barcode value with a String #155

Closed HannHank closed 4 years ago

HannHank commented 4 years ago

i cannot compare the value barcode, with a simple String.

String barcode = await BarcodeScanner.scan(); if(barcode == '1'){ I do not know why, but if I log the qrcode in the Terminal it show "1" so it have to be true, but the code do not go inside, that if statement.

thanks in advanced

irperera commented 4 years ago

what error do you get?

HannHank commented 4 years ago

Sorry I forgot to close that issue, the issue was, that the Qrcode had a speace at the End. So in ther Terminal "1" and "1 " looks the same, but it isn't :). So for anyone you have the same Problem with string comparison, checking the length of the String, might be a good idea.