繁体   English   中英

如何在浏览器中打开 flutter web 应用程序,就像 html 文件一样

[英]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并且网站加载

您不能直接打开 flutter web 项目。

这是因为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如果本地服务器不可用,您的应用程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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