小编Red*_*ath的帖子

无需 Android Studio 即可在本地运行 Flutter Web 应用程序

我有一个使用 Firebase 的云 firestore 的 flutter 应用程序。我已经完成了 Web 构建,并通过 Android Studio 在 Chrome 上运行它,效果很好。我想向我的客户分享我的网络应用程序进度,但不想托管它(因为它尚未完成)。因此,我想找到一种在本地运行它的方法,就像使用 Android Studio 一样,但不需要安装 Android Studio(希望也不需要安装 flutter),这样我就可以将构建文件发送到我的客户,他们可以在他们的机器上运行它(使用脚本在本地启动 Web 服务器并运行 Web 应用程序)。

我已经尝试了 web build 文件夹中包含的以下脚本(index.html 所在的位置)

from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from httplib import HTTPResponse
from os import curdir,sep

#Create a index.html aside the code
#Run: python server.py
#After run, try http://localhost:8080/

class RequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        if self.path == '/':
            self.path  = '/index.html'
        try:
            sendReply = False
            if self.path.endswith(".html"):
                mimeType = 'text/html'
                sendReply = True
            if sendReply …
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-web

8
推荐指数
1
解决办法
8623
查看次数

添加链接到alertdialog文本android

我正在创建一个alertdialog,在消息中我放了一个String.该字符串带有一些我希望将它们作为链接的文本,因此当它们显示在对话框中时,用户可以单击它们并转到其他视图.让我告诉你一个我想要的例子:

public class Activity extends FragmentActivity{

(...)

    public void myMethod(){
        String message = "Some links: link1, link2, link3";
        AlertDialog.Builder builder = new AlertDialog.Builder(this)
        builder.setTitle("This is a title");
        builder.setMessage(message);
        builder.setCancelable(true);
        builder.setOnCancelListener(onCancelListener);
        builder.create().show();
    }
}
Run Code Online (Sandbox Code Playgroud)

我想对link1,link2和link3做一些事情,所以当它们显示在对话框中时,它们显示为链接.然后,当用户点击link1时,会显示一个新活动; 当点击链接2时,会显示另一个视图,并且与link3相同.

我希望有一个onlinkclicklistener或类似的东西,所以我在用户点击链接时捕获.

有关如何做到这一点的任何想法?我希望你能理解我想要的东西:)

android hyperlink android-alertdialog

1
推荐指数
1
解决办法
4658
查看次数