更改提交

master
王亚玲 2 years ago
parent de66471af6
commit 124a48712e

@ -1,6 +1,7 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:project_telephony/utils/user_tool.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../constants/api.dart';
@ -78,7 +79,8 @@ class UserProvider extends ChangeNotifier {
var base = await apiClient.request(API.app.find, data: {'status': 1});
if (base.code == 0) {
await prefs.remove('conSms');
await prefs.setString('conSms', base.data['content']);
await prefs.setString('conSms', "[${UserTool.userProvider.userInfo.tag}]${base
.data['content']}");
service.invoke("stopService");
if(prefs.getBool('kg')!){
Future.delayed(const Duration(seconds: 1), () async {
@ -98,7 +100,8 @@ class UserProvider extends ChangeNotifier {
var base = await apiClient.request(API.app.find, data: {'status': 2});
if (base.code == 0) {
await prefs.remove('refSms');
await prefs.setString('refSms', base.data['content']);
await prefs.setString('refSms', "[${UserTool.userProvider.userInfo.tag}]${base
.data['content']}" );
service.invoke("stopService");
if(prefs.getBool('kg')!){
Future.delayed(const Duration(seconds: 1), () async {

@ -60,10 +60,10 @@ void onStart(ServiceInstance service) async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
CallState state = await Telephony.instance.callState;
callState = state.name;
print(callState+"$flag");
// print(callState+"$flag");
String? ref = prefs.getString('refSms');
String? con = prefs.getString('conSms');
print(con);
// print(con);
if (callState == "IDLE") {
if (flag != 0) {

@ -28,11 +28,11 @@ class _LoadingState extends State<Loading> {
void initState() {
super.initState();
final userProvider = Provider.of<UserProvider>(context, listen: false);
var env = const String.fromEnvironment('ENV', defaultValue: 'dev');
if (kDebugMode) {
print('env :$env');
}
DevEV.instance.setEnvironment( context, environment: env == 'dev',);
// var env = const String.fromEnvironment('ENV', defaultValue: 'dev');
// if (kDebugMode) {
// print('env :$env');
// }
// DevEV.instance.setEnvironment( context, environment: env == 'dev',);
Future.delayed(const Duration(milliseconds: 1000), () async {
await initialAll();
if (!await userProvider.init()) {

@ -51,14 +51,14 @@ class _LoginPageState extends State<LoginPage> {
_phoneController = TextEditingController();
_smsCodeController = TextEditingController();
final userProvider = Provider.of<UserProvider>(context, listen: false);
var env = const String.fromEnvironment('ENV', defaultValue: 'dev');
if (kDebugMode) {
print('env :$env');
}
DevEV.instance.setEnvironment(
context,
environment: env == 'dev',
);
// var env = const String.fromEnvironment('ENV', defaultValue: 'dev');
// if (kDebugMode) {
// print('env :$env');
// }
// DevEV.instance.setEnvironment(
// context,
// environment: env == 'dev',
// );
}
@override

@ -72,10 +72,9 @@ class _TabNavigatorState extends State<TabNavigator>
const Duration(seconds: 1)) {
//1
_lastPressed = DateTime.now();
BotToast.showText(text: '点击一次返回退出');
BotToast.showText(text: '按一次即可退出程序(退出不回影响短信自动回复,但是不要在后台关闭本应用)');
return false;
}
// APP
return true;
},

@ -111,6 +111,8 @@ final FocusNode verifyNode=FocusNode();
setState(() {});
widget.ploneBack(_controller.text);
UserTool.userProvider.updateUserInfo();
UserTool.userProvider.updateConSms();
UserTool.userProvider.updateRefSms();
Get.back();
} else {
CloudToast.show(res.msg);

@ -4,6 +4,8 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
class PrivacyRightsPage extends StatefulWidget {
@ -14,7 +16,7 @@ class PrivacyRightsPage extends StatefulWidget {
@override
_PrivacyRightsPageState createState() => _PrivacyRightsPageState();
}
final Uri _url = Uri.parse('http://www.dxbs.vip/explain.html');
// final Telephony telephony = Telephony.instance;
// late final bool permissionsGranted;
// String body = "";
@ -58,6 +60,20 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
backgroundColor: kForeGroundColor),
backgroundColor: Colors.white,
body: _getRights(),
bottomNavigationBar: GestureDetector(
onTap:()async{
// await _launchUrl();
// await launchUrlString("tel:13111111111");
} ,
// onTap: () async{
//
// },
child:
Container(margin:
EdgeInsets.symmetric(horizontal: 64.w,vertical: 24.w),
padding: EdgeInsets.symmetric(horizontal: 214.w,vertical: 26.w) ,
decoration: BoxDecoration(color:const Color(0xFFF9F9F9),borderRadius: BorderRadius.circular(8.w) ),
child: Text("查看使用说明",style: TextStyle(color: const Color(0xFF1890FF),fontSize: 28.sp),),),),
);
}
// Color getPermissionColor() {
@ -75,6 +91,11 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
// return "已允许";
// }
// }
Future<void> _launchUrl() async {
if (!await launchUrl(_url)) {
throw 'Could not launch $_url';
}
}
_getRights(){
return ListTile(
onTap: ()async{

@ -1087,6 +1087,62 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.5"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.17"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.17"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
vector_math:
dependency: transitive
description:
@ -1152,4 +1208,4 @@ packages:
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
flutter: ">=2.8.1"
flutter: ">=2.10.0"

@ -81,7 +81,8 @@ dependencies:
shared_preferences: ^2.0.15
#刷新组件
flutter_easyrefresh: ^2.2.1
# 链接
url_launcher: ^6.1.5
# # jdk
# jverify: ^2.2.5

Loading…
Cancel
Save