• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

Flutter高仿微信-第24篇-隐私政策

武飞扬头像
六毛六66
帮助1

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);
          },
        ),
      ],
    ),
  );
}
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgcbggf
系列文章
更多 icon
同类精品
更多 icon
继续加载