|
|
|
@ -1,31 +1,28 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
|
import 'package:permission_handler_platform_interface/permission_handler_platform_interface.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:project_telephony/base/base_style.dart';
|
|
|
|
|
import 'package:project_telephony/ui/login/login_page.dart';
|
|
|
|
|
import 'package:project_telephony/ui/tab_navigator.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:project_telephony/ui/user/members_page.dart';
|
|
|
|
|
import 'package:project_telephony/ui/user/privacy_rights_page.dart';
|
|
|
|
|
import 'package:project_telephony/ui/widget/image_scaffold.dart';
|
|
|
|
|
import 'package:project_telephony/ui/widget/plone_bottom.dart';
|
|
|
|
|
import 'package:project_telephony/ui/widget/plone_image_picker.dart';
|
|
|
|
|
import 'package:project_telephony/utils/headers.dart';
|
|
|
|
|
import 'package:project_telephony/utils/permissionutils.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:telephony/telephony.dart';
|
|
|
|
|
import 'package:workmanager/workmanager.dart';
|
|
|
|
|
|
|
|
|
|
import '../../constants/api.dart';
|
|
|
|
|
import '../../model/network/api_client.dart';
|
|
|
|
|
import '../../permission.dart';
|
|
|
|
|
|
|
|
|
|
import '../../providers/user_provider.dart';
|
|
|
|
|
import '../../utils/toast/cloud_toast.dart';
|
|
|
|
|
import '../../utils/user_tool.dart';
|
|
|
|
|
import '../home/call.dart';
|
|
|
|
|
|
|
|
|
|
import '../home/content_details_page.dart';
|
|
|
|
|
import '../home/home_page.dart';
|
|
|
|
|
|
|
|
|
@ -239,7 +236,6 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
|
|
|
|
|
//内容
|
|
|
|
|
_getSwitch(String url, String name, bool pd) {
|
|
|
|
|
num a=0;
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
pd
|
|
|
|
@ -277,28 +273,12 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
value: vle,
|
|
|
|
|
onChanged: (value) async{
|
|
|
|
|
vle=value;
|
|
|
|
|
print(vle);
|
|
|
|
|
if(vle) {
|
|
|
|
|
Telephony.backgroundInstance.sendSms(to: "13395740386", message: "啦啦啦啦啦");
|
|
|
|
|
// Workmanager().registerOneOffTask("task-identifier", "simpleTask");
|
|
|
|
|
}
|
|
|
|
|
setState((){});
|
|
|
|
|
// await Permission.phone.request();
|
|
|
|
|
// List<Permission> permissions = [
|
|
|
|
|
// Permission.sms,
|
|
|
|
|
// Permission.phone,
|
|
|
|
|
// ];
|
|
|
|
|
// PermissionHelper.check(permissions, onSuccess: () {
|
|
|
|
|
// print('onSuccess');
|
|
|
|
|
// }, onFailed: () {
|
|
|
|
|
// print('onFailed');
|
|
|
|
|
// }, onOpenSetting: () {
|
|
|
|
|
// print('onOpenSetting');
|
|
|
|
|
// openAppSettings();
|
|
|
|
|
// });
|
|
|
|
|
// setState(() {
|
|
|
|
|
// vle = value;
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
: const Icon(Icons.keyboard_arrow_right)),
|
|
|
|
|
),
|
|
|
|
|