I have generated a QrCode from flutter using "qr_flutter: 4.0.0" and I am scanning it from a different app using "mobile_scanner: ^3.0.0". What I want here is that after I scan the QR I don’t it to be scanable again. It should Simply show the details of the QR and also say that it is redeemed.
Please let me know if there is a solution for this. Thanks!
2
Answers
A "QR Code" is not a magical thing, it’s just data serialization.
So if for example the data in your QR code is "www.webshop.example.com/coupon/123" then you cannot change that. That is the data. Just imagine you printed it in a magazine or hung it in a window.
What you can do is have a database of your coupons, where you can add as much details to "123" as you want, any time you want.
For example, you could have a list of users that has already redeemed it. Then when a user uses the URL/coupon code "123" you can decide, has this user used it before, then show "already used", else give 10% off. Or anything else you want.
So to summarize: you cannot change the QR code, you can change the data attached to it in your database to do anything you want to do.
Is your data that generated into QR stored in any database? If data stored the answer is yes. You can generate single use QR codes.