privacy_policy_page.dart 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. import 'dart:io';
  2. import 'package:flutter/gestures.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:liftmanager/custom_route.dart';
  5. import 'package:liftmanager/internal/home/splash_page.dart';
  6. import 'package:liftmanager/internal/work/work_router.dart';
  7. import 'package:liftmanager/routers/fluro_navigator.dart';
  8. import 'package:liftmanager/widgets/my_button.dart';
  9. // import 'package:mis_mobile/common/components/card.dart';
  10. // import 'package:mis_mobile/common/components/scaffold.dart';
  11. // import 'package:mis_mobile/common/components/webview_wrapper.dart';
  12. // import 'package:mis_mobile/common/global_config.dart';
  13. // import 'package:mis_mobile/common/utils/custom_route.dart';
  14. // import 'package:mis_mobile/common/utils/toast_helper.dart';
  15. // import 'package:mis_mobile/screens/splash.dart';
  16. import 'package:shared_preferences/shared_preferences.dart';
  17. class PrivacyPolicyPage extends StatefulWidget {
  18. @override
  19. _PrivacyPolicyPageState createState() => _PrivacyPolicyPageState();
  20. }
  21. class _PrivacyPolicyPageState extends State<PrivacyPolicyPage> {
  22. @override
  23. void initState() {
  24. // TODO: implement initState
  25. super.initState();
  26. initData();
  27. }
  28. var sharedPref;
  29. initData() async {
  30. sharedPref = await SharedPreferences.getInstance();
  31. bool isAree = sharedPref.getBool('isAreeYs') ?? false;
  32. if (isAree) {
  33. Navigator.pushReplacement(context, CustomRouteJianBian(SplashPage()));
  34. }
  35. }
  36. @override
  37. Widget build(BuildContext context) {
  38. // SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
  39. return Scaffold(
  40. body: Column(children: [
  41. SingleChildScrollView(
  42. child: Container(
  43. child: Column(
  44. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  45. crossAxisAlignment: CrossAxisAlignment.start,
  46. children: [
  47. Padding(
  48. padding: const EdgeInsets.all(22.0),
  49. child: Column(
  50. crossAxisAlignment: CrossAxisAlignment.start,
  51. children: [
  52. Text(
  53. "感谢您使用电梯管家!",
  54. style: TextStyle(
  55. fontSize: 18.0, fontWeight: FontWeight.bold),
  56. ),
  57. SizedBox(
  58. height: 10,
  59. ),
  60. Container(
  61. color: Color(0xffF2F2F2),
  62. padding: EdgeInsets.all(20.0),
  63. child: RichText(
  64. text: TextSpan(
  65. text: "感谢您信任并选择电梯管家,我们非常重视保护您的个人信息与隐私!"
  66. "依据最新的监管要求,我们特向您说明如下:\n\n",
  67. style: TextStyle(color: Colors.black, fontSize: 16),
  68. children: [
  69. TextSpan(text: "1. 为向您提供良好的服务,我们将根据法律及"),
  70. TextSpan(
  71. text: "《服务协议和隐私政策》",
  72. style: TextStyle(
  73. color: Colors.blue,
  74. ),
  75. recognizer: TapGestureRecognizer()
  76. ..onTap = () {
  77. NavigatorUtils.push(
  78. context,
  79. "${WorkRouter.webview}?title=" +
  80. Uri.encodeComponent("电梯管家协议") +
  81. "&url=" +
  82. Uri.encodeComponent(
  83. "http://dl.edtyun.com/xieyi.html"));
  84. }),
  85. TextSpan(
  86. text: "收集,使用提供服务所必需的个人信息;\n\n",
  87. style: TextStyle(
  88. color: Colors.black,
  89. ),
  90. ),
  91. TextSpan(
  92. text: "2. 基于您的明示授权,我们可能会调取您的相机,相册,存储空间,定位等设备权限,"
  93. "用于出诊打卡等功能,您有权拒绝或取消授权。\n\n"
  94. "3. 当你使用电梯管家服务时,为保障你正常使用我们的服务,维护我们服务的正常运行,"
  95. "改进及优化我们的服务体验以及保障你的帐号安全,我们会收集你的设备型号、操作系统、"
  96. "唯一设备标识符(指由设备制造商编入到设备中的一串字符,可用于以独有方式标识相应设备)、"
  97. "登录IP地址、电梯管家软件版本号、接入网络的方式、类型和状态、"
  98. "操作日志、服务日志信息(如服务故障信息)等日志信息,"
  99. "这类信息是为提供服务必须收集的基础信息。\n"),
  100. ],
  101. ),
  102. ),
  103. ),
  104. ],
  105. ),
  106. ),
  107. ],
  108. ),
  109. ),
  110. ),
  111. Padding(
  112. padding: const EdgeInsets.symmetric(horizontal: 22.0, vertical: 15.0),
  113. child: Row(
  114. children: [
  115. Expanded(
  116. child: MyButton(
  117. backColor: Color(0xffE8E8E8),
  118. onPressed: () {
  119. showConfirmDialog(
  120. context, '不同意将无法使用我们的产品和服务,并会退出app', () => exit(0));
  121. },
  122. )
  123. // MisCard(
  124. // isClip: true,
  125. // radius: 5,
  126. // child: InkWell(
  127. // onTap: () {
  128. // showConfirmDialog(
  129. // context, '不同意将无法使用我们的产品和服务,并会退出app', () => exit(0));
  130. // },
  131. // child: Container(
  132. // height: 50,
  133. // alignment: Alignment.center,
  134. // color: Color(0xffE8E8E8),
  135. // child: Text(
  136. // "不同意,暂不使用",
  137. // style: TextStyle(
  138. // fontSize: 16,
  139. // color: Color(0xff999999),
  140. // ),
  141. // ),
  142. // ),
  143. // ),
  144. // ),
  145. ),
  146. SizedBox(
  147. width: 10.0,
  148. ),
  149. Expanded(child: MyButton(
  150. onPressed: () {
  151. sharedPref.setBool('isAreeYs', true);
  152. Navigator.pushReplacement(
  153. context,
  154. CustomRouteJianBian(
  155. SplashPage(),
  156. ),
  157. );
  158. },
  159. )),
  160. ],
  161. ),
  162. )
  163. ]));
  164. }
  165. }
  166. void showConfirmDialog(
  167. BuildContext context, String content, Function confirmCallback,
  168. {Function cancelCallback, bool outTouchCancellable = true}) {
  169. showDialog(
  170. barrierDismissible: outTouchCancellable,
  171. context: context,
  172. builder: (context) {
  173. return new AlertDialog(
  174. title: new Text("提示"),
  175. content: new Text(content),
  176. actions: <Widget>[
  177. new FlatButton(
  178. onPressed: () {
  179. Navigator.of(context).pop();
  180. confirmCallback?.call();
  181. },
  182. child: new Text("确认"),
  183. ),
  184. new FlatButton(
  185. onPressed: () {
  186. Navigator.of(context).pop();
  187. cancelCallback?.call();
  188. },
  189. child: new Text("取消"),
  190. ),
  191. ],
  192. );
  193. });
  194. }