我想导航到文本中的特定URL。我能够使用PHP将来自Textfield的数据发布到MySQL数据库中。我也成功地展示了这篇文章。有时,这个文本可能包含许多URL。我想导航到那些URL。我不想为这些URL创建单独的TextFields作为no。URL是不可预测的。
示例
请通过该链接学习HTML http://www.w3schools.com/。 请通过该链接学习https://www.youtube.com/的优秀内容。 对于颤振资源https://flutter.dev/
以上都是一条单一的信息。
发布于 2020-01-16 07:37:24
使用这个包链接化。它将处理字符串中的超链接。
示例
Linkify(
onOpen: (link) async {
//use flutter url_launcher package to open links in browser
if (await canLaunch(link.url)) {
await launch(link.url);
} else {
throw 'Could not launch $link';
}
},
text: "Made by https://cretezy.com",
style: TextStyle(color: Colors.yellow),
linkStyle: TextStyle(color: Colors.red),
);https://stackoverflow.com/questions/59764791
复制相似问题