简体   繁体   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 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.

相关问题 如何在浏览器本地打开编译好的Flutter web index.html? - How to open compiled Flutter web index.html in browser locally? 如何从任何 web 浏览器打开 flutter 应用程序? - How to open flutter app from any web browser? Flutter 如何使用 web 浏览器打开 pdf - Flutter how to open pdf using web browser 如何在 Flutter Web 应用中打开 Viber 应用? - How to open Viber app in Flutter web app? 为什么我的 Flutter web 应用调试在浏览器中打不开? - Why won't my Flutter web app debug open in the browser? 如何构建 FCM 推送通知以在 Flutter(Android 和 iOS)中的默认系统 Web 浏览器应用程序中打开指定的 URL - How to construct FCM push notification to open specified URL in default system web browser app in Flutter (Android & iOS) 如何收听 Flutter 应用内网页浏览器? - How to listen to the Flutter in-app web browser? 在浏览器的 assets 文件夹中显示本地存储的 html 文件 Flutter Web - Display locally stored html file in assets folder on browser in Flutter Web 我们可以在 flutter 中的 web 文件夹中找到 html 文件,如 APK 文件位于 build\app\outputs\apk\debug - Where we can find the html file in our folder for the web in flutter like APK file locate in build\app\outputs\apk\debug 如何在Flutter应用中打开DropBox下载的文件? - How to open a file downloaded by DropBox in a Flutter app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM