|
|
@ -1,4 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -8,8 +7,6 @@ import 'package:project_telephony/ui/widget/plone_back_button.dart';
|
|
|
|
import 'package:project_telephony/utils/headers.dart';
|
|
|
|
import 'package:project_telephony/utils/headers.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PrivacyRightsPage extends StatefulWidget {
|
|
|
|
class PrivacyRightsPage extends StatefulWidget {
|
|
|
|
final String name;
|
|
|
|
final String name;
|
|
|
|
|
|
|
|
|
|
|
@ -30,6 +27,7 @@ final Uri _url = Uri.parse('https://www.dxbs.vip//explain.html');
|
|
|
|
bool sms = false;
|
|
|
|
bool sms = false;
|
|
|
|
bool plone = false;
|
|
|
|
bool plone = false;
|
|
|
|
bool callLog = false;
|
|
|
|
bool callLog = false;
|
|
|
|
|
|
|
|
bool contacts = false;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
|
|
|
|
class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
|
|
|
@ -45,6 +43,7 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
|
|
|
|
sms = await Permission.sms.request().isGranted;
|
|
|
|
sms = await Permission.sms.request().isGranted;
|
|
|
|
plone = await Permission.phone.request().isGranted;
|
|
|
|
plone = await Permission.phone.request().isGranted;
|
|
|
|
callLog = await Permission.callLog.request().isGranted;
|
|
|
|
callLog = await Permission.callLog.request().isGranted;
|
|
|
|
|
|
|
|
contacts = await Permission.contacts.request().isGranted;
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -69,6 +68,7 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
|
|
|
|
_getRights("获取设备来电状态", "用于获取来电状态", plone),
|
|
|
|
_getRights("获取设备来电状态", "用于获取来电状态", plone),
|
|
|
|
_getRights("获取设备短信权限", "用于发送短信", sms),
|
|
|
|
_getRights("获取设备短信权限", "用于发送短信", sms),
|
|
|
|
_getRights("获取设备通话记录", "用于获取来电", callLog),
|
|
|
|
_getRights("获取设备通话记录", "用于获取来电", callLog),
|
|
|
|
|
|
|
|
_getRights("获取设备通讯录", "用于插入排除手机号", contacts),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomNavigationBar: GestureDetector(
|
|
|
|
bottomNavigationBar: GestureDetector(
|
|
|
@ -121,6 +121,7 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
if (!state) {
|
|
|
|
if (!state) {
|
|
|
|
openAppSettings();
|
|
|
|
openAppSettings();
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if(!(sms && plone)){
|
|
|
|
// if(!(sms && plone)){
|
|
|
|
// // print(sms);
|
|
|
|
// // print(sms);
|
|
|
|