[英]How to open flutter web app in browser just like a html file
I was trying out flutter web and I wanted to share what I built with my friend so I wanted to know how to make my flutter web app open and run in browser just like html file where you would just click the file and open it with chrome and the site loads up I was trying out flutter web and I wanted to share what I built with my friend so I wanted to know how to make my flutter web app open and run in browser just like html file where you would just click the file and open it with chrome并且网站加载
You cant open a flutter web project directly.您不能直接打开 flutter web 项目。
This is because flutter build web
, will produce a Single Page App or SPA
that will not work unless it's hosted via a server.这是因为flutter build web
将生成单页应用程序或SPA
,除非它通过服务器托管,否则将无法正常工作。
The user will either have to run a local server in-order to view the pages and for that you can use python 3's http.serve
command or the dart
variant dhttpd
, the option is you can use a hosting solution like firebase
or netlify
to host your application if a local server is not possible. The user will either have to run a local server in-order to view the pages and for that you can use python 3's http.serve
command or the dart
variant dhttpd
, the option is you can use a hosting solution like firebase
or netlify
to host如果本地服务器不可用,您的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.