Flutter高仿微信系列共59篇,从Flutter客户端、Kotlin客户端、Web服务器、数据库表结构、Xmpp即时通讯服务器、视频通话服务器、腾讯云服务器全面讲解。
详情请查看
效果图:

实现代码:
/**
* 显示服务条款、隐私政策对话框
*/
static void showServiceTermsDialog(BuildContext context,{String cancel = "不同意", String ok = "同意"}) {
String title = "欢迎使用宏辉";
String content1 = "感谢您选择宏辉APP!"+
"\n1、我们非常重视您的个人信息及隐私保护! 在您使用我们的产品前,请务必认真阅读";
String content2 = "的所有内容。"+
"\n2、我们会遵循隐私收集、使用信息,但不会因为同意了本隐私而进行强制式的信息收集。"+
"\n3、相册、麦克风、摄像头等敏感权限不会默认开启,只有经过授权才会在使用功能时打开。"+
"\n如果您对以上协议有任何问题,请发邮件至maoning20080809@163.com与我们联系。"+
"\n如您同意以上协议内容,请点击“同意”,开始使用我们的产品和服务。";
showPlatformDialog(
context: context,
builder: (_) => BasicDialogAlert(
title: Text(title),
//content: Text(content),
content: RichText(
text: TextSpan(
//text: '登陆即同意',
style: TextStyle(color: Colors.black),
children: [
TextSpan(
text: content1,
style: TextStyle(color: Colors.black),
),
TextSpan(
text: '《用户协议》',
style: TextStyle(color: Colors.red),
recognizer: TapGestureRecognizer()
..onTap = () {
String url = CommonUtils.BASE_URL_SYSTEMFILE+"wnchat_privacy_policy.html";
String title = "用户协议";
Navigator.push(context, MaterialPageRoute(builder: (context) => WebViewWidget(title: title, url: url)));
},
),
TextSpan(
text: '及',
style: TextStyle(color: Colors.black),
),
TextSpan(
text: '《隐私政策》',
style: TextStyle(color: Colors.red),
recognizer: TapGestureRecognizer()
..onTap = () {
String url = CommonUtils.BASE_URL_SYSTEMFILE+"wnchat_privacy_policy.html";
String title = "隐私政策";
Navigator.push(context, MaterialPageRoute(builder: (context) => WebViewWidget(title: title, url: url)));
},
),
TextSpan(
text: content2,
style: TextStyle(color: Colors.black),
),
],
),
),
actions: <Widget>[
BasicDialogAction(
title: Text(cancel),
onPressed: () {
exit(0);
},
),
BasicDialogAction(
title: Text(ok),
onPressed: () {
SpUtils.setBool(CommonUtils.SERVICE_TERMS, true);
Navigator.pop(context);
},
),
],
),
);
}


















