简体   繁体   中英

Flutter Web: How to create a flutter web app which opens when a QR code is scanned

I am developing a QR menu app using Flutter. A Flutter mobile app will handle the part of uploading menus. Each menu's data is uploaded to the Firestore database. And each and every menu will have a menu_id to identify the menu.

I am hoping to use flutter web for the part when a user scans the QR code which has a generated specific URL using menu data (I think I can use the menu_id to query the menu data), open a website that shows menu data.

My concerns are

  1. How can I build a flutter web app which has a unique URL for every menu?
  2. How can I generate that URL in flutter mobile?

give names to all routes

ex:

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (context) => Page(),
    settings: RouteSettings(name: "page")),
);

and you can access there in the browser:

http://localhost:12345/page

or


https://yourActualWebserverAddress/page

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM