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


    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: [
            BasicDialogAction(
              title: Text(cancel),
              onPressed: () {
                exit(0);
              },
            ),
            BasicDialogAction(
              title: Text(ok),
              onPressed: () {
                SpUtils.setBool(CommonUtils.SERVICE_TERMS, true);
                Navigator.pop(context);
              },
            ),
          ],
        ),
      );
    }

  • 相关阅读:
    tomcat 部署web项目
    基于战争优化算法(WSO)的光伏模型参数估计研究(Matlab代码实现)
    快速替换jar包中.class、.html、.yml格式的文件
    【软件测试】一线大厂的测试开发基本技能,我不再想庸庸碌碌......
    Mybatis-Plus最新教程
    MyBatis-Plus常用注解
    函数式编程01
    【opencv图像处理】-- 7. 图像金字塔与直方图
    【概率论与数理统计(研究生课程)】知识点总结1(概率论基础)
    Web 性能指标
  • 原文地址:https://blog.csdn.net/maoning20080808/article/details/128000581