如何找到为flutter web应用程序提供服务的URL?

如何找到为flutter web应用程序提供服务的URL?,flutter,flutter-web,Flutter,Flutter Web,我希望我的Web应用程序可以在以下位置使用: http://example.com/ui/ # My flutter web application http://example.com/api/... # REST endpoints 如何找到下载我的应用程序的URL(http://example.com/ui/),以便生成URLhttp://example.com/api/从它开始 我不希望将example.com烘焙到webapp中,因为我们在CI期间部署到许多具有不

我希望我的Web应用程序可以在以下位置使用:

  http://example.com/ui/      # My flutter web application
  http://example.com/api/...  # REST endpoints
如何找到下载我的应用程序的URL(
http://example.com/ui/
),以便生成URL
http://example.com/api/
从它开始

我不希望将
example.com
烘焙到webapp中,因为我们在CI期间部署到许多具有不同域名的集群

import 'dart:html' as html;

...
debugPrint('host=${html.window.location.host + html.window.location.pathname}');
...