Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase托管-Flatter Web应用程序托管额外的.html页面_Firebase_Flutter_Dart_Firebase Hosting_Flutter Web - Fatal编程技术网

Firebase托管-Flatter Web应用程序托管额外的.html页面

Firebase托管-Flatter Web应用程序托管额外的.html页面,firebase,flutter,dart,firebase-hosting,flutter-web,Firebase,Flutter,Dart,Firebase Hosting,Flutter Web,我目前正在开发一个在Firebase上托管的Flitter web应用程序。该web应用程序为用户提供了一个图像上传功能,它使用了另一个位于assets文件夹中的HTML页面(这样做是因为我在该页面上使用了一些JS LIB,而我在dart中没有找到)。这个html页面是在一个额外的窗口中从dart调用的-在本地这很好-我刚刚在localhost/assets/html/uploadImage.html打开页面,窗口出现了。但是,在Firebase上托管时,这不起作用。在这里,我调用/assets

我目前正在开发一个在Firebase上托管的Flitter web应用程序。该web应用程序为用户提供了一个图像上传功能,它使用了另一个位于assets文件夹中的HTML页面(这样做是因为我在该页面上使用了一些JS LIB,而我在dart中没有找到)。这个html页面是在一个额外的窗口中从dart调用的-在本地这很好-我刚刚在localhost/assets/html/uploadImage.html打开页面,窗口出现了。但是,在Firebase上托管时,这不起作用。在这里,我调用/assets/html/uploadImage.html——但只得到一个空白页面。我有点理解静态文件在Firebase上的托管方式与本地不同,但我不明白我在这里做错了什么。是否有一些可配置的东西来承载这一额外的页面


很高兴听到你的想法

另一种方法是将html添加到web文件夹中,然后从那里启动它,这样当您启动它时,您将只拥有您的domain.web.app/my.html

flatter web/Firebase主机 如果您试图仅为Flatter web提供静态HTML文件,则可以将它们放在webbuild文件夹中

您还需要调整您的应用程序,以便您的应用程序不会自动从静态html文件重定向回应用程序

下面的示例将允许用户访问你的app.com/example/staticwebpage.html,而无需重定向回flatter应用程序

  "rewrites": [
    {
      "source": "/example/staticwebpage.html",
      "destination": "/example/staticwebpage.html",
    },
    {
      "source": "**",
      "destination": "/index.html"
    }
  ]
在Flatter iOS和Android上提供HTML 如果您需要在iOS和Android Flatter应用程序上提供HTML文件,则需要使用其中一个软件包。他们将在应用程序内的web浏览器中提供这些页面