Home > Back-end >  How to generate QR code for every prediction?
How to generate QR code for every prediction?

Time:06-07

I've created a mobile app with Flutter framework that can predict laptop prices. Now, I want to add a special functionality: for every prediction the user does, I want the app to generate a QR Code with the price, so that another user scan it, and it will automatically fill his characteristics like the other user. Characteristics forum Characteristics forum the price of laptop, under it, i want to generate a QR code

CodePudding user response:

Your QR code generator string must contain all characteristics that the creator entered Ex.: User x created a computer with 16GB ram & Core i7 7700HQ etc.. the generator string should be {"ram":"16gb","cpu":"i7 7700hq",...} you can use a Map<String, String> for the entered characteristics and use jsonEncode(yourMap) to convert it to string and pass it the the QR Code generator

when the receiver scan the QR Code, he will get {"ram":"16gb","cpu":"i7 7700hq",...}, use jsonDecode(yourMap) to reconvert the string to Map<String, String> characteristics in your receiver's device, predict the price according to what you got in the map

CodePudding user response:

there is a package called qr_flutter you can throw data to it and it will generate a QR code for the user

package : https://pub.dev/packages/qr_flutter

  • Related