如何制作颤振超链接?
如何在 flutter 中创建电子邮件超链接? /////////////////////////////////////////////////////////// ///////////////////
import 'package:flutter/material.dart';
showAlertDialog(BuildContext context) {
AlertDialog alert = const AlertDialog(
title: Text('Contact us'),
content: Text(
'Please contact our team via email: **[email protected]**', //hyperlink
),
);
showDialog(
context: context,
builder: (BuildContext context){
return alert;
},
);
}
how do I create an email hyperlin in flutter?
////////////////////////////////////////////////////////////
import 'package:flutter/material.dart';
showAlertDialog(BuildContext context) {
AlertDialog alert = const AlertDialog(
title: Text('Contact us'),
content: Text(
'Please contact our team via email: **[email protected]**', //hyperlink
),
);
showDialog(
context: context,
builder: (BuildContext context){
return alert;
},
);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Flutter 本身支持富文本,但我认为这对你来说还不够。您可以使用这个包进行操作,并且您可以直接处理您的链接。(如果您愿意的话)应该是为链接编写自定义操作,例如下面的代码)
Flutter natively support Rich text, but I think doesn't enough for you. You can use this package for your operations, and you can handle your link directly.(If you want you should be to write custom action for links for instance below code)
使用包 url_launcher:
Use Package url_launcher:
简单来说,您可以使用此包直接发送电子邮件
email_launcher: ^1.1.1
Simply, you can use this package to send email directly
email_launcher: ^1.1.1