master
王亚玲 2 years ago
parent db379a3bda
commit f021eaad20

@ -195,7 +195,7 @@ class UserProvider extends ChangeNotifier {
var base = await apiClient.request(API.exclude.find); var base = await apiClient.request(API.exclude.find);
if (base.code == 0) { if (base.code == 0) {
await prefs.remove('exclude'); await prefs.remove('exclude');
await prefs.setStringList('exclude', base.data ?? []); await prefs.setStringList('exclude', base.data ?? [] as List<String>);
service.invoke("stopService"); service.invoke("stopService");
if (prefs.getBool('kg') ?? false) { if (prefs.getBool('kg') ?? false) {
Future.delayed(const Duration(seconds: 1), () async { Future.delayed(const Duration(seconds: 1), () async {

@ -221,6 +221,7 @@ class _AddressBookState extends State<AddressBook> {
title: item.title ?? "", title: item.title ?? "",
index: index, index: index,
))).then((value) => _easyRefreshController.callRefresh()); ))).then((value) => _easyRefreshController.callRefresh());
print(index);
}, },
child: Text( child: Text(
"${item.title}($num)", "${item.title}($num)",

@ -8,7 +8,7 @@ import '../../model/hive/phone_model.dart';
import '../../utils/user_tool.dart'; import '../../utils/user_tool.dart';
import '../exclude/exclude_contacts_page.dart'; import '../exclude/exclude_contacts_page.dart';
import '../exclude/exclude_single_page.dart'; import '../exclude/exclude_single_page.dart';
import '../login/login_page.dart';
import '../widget/plone_back_button.dart'; import '../widget/plone_back_button.dart';
class CallListPage extends StatefulWidget { class CallListPage extends StatefulWidget {
@ -80,7 +80,7 @@ class _CallListPageState extends State<CallListPage> {
_getBottom("号码添加", const Color(0xFF1890FF), () { _getBottom("号码添加", const Color(0xFF1890FF), () {
Navigator.of(context) Navigator.of(context)
.push( .push(
MaterialPageRoute(builder: (_) => const ExcludeSinglePage( qf: true,)), MaterialPageRoute(builder: (_) => ExcludeSinglePage( qf: true,index: widget.index,)),
) )
.then((value) => _refreshController.callRefresh()); .then((value) => _refreshController.callRefresh());
}, Colors.white, Colors.white, 2, const Color(0xFF1890FF), 58, 24), }, Colors.white, Colors.white, 2, const Color(0xFF1890FF), 58, 24),

@ -38,7 +38,7 @@ class _AnswerIdleListState extends State<AnswerIdleList>
List<String> textListSMS = []; List<String> textListSMS = [];
List<int> smsIdList = []; List<int> smsIdList = [];
int isCheck = 0; int isCheck = 0;
bool val = false; bool val = true;
// final EasyRefreshController _easyRefreshController = EasyRefreshController(); // final EasyRefreshController _easyRefreshController = EasyRefreshController();
@override @override

@ -57,8 +57,8 @@ void onStart(ServiceInstance service) async {
String? con = prefs.getString('conSms'); String? con = prefs.getString('conSms');
String? call = prefs.getString('callSms'); String? call = prefs.getString('callSms');
String? idle = prefs.getString('idleSms'); String? idle = prefs.getString('idleSms');
bool? callSw = prefs.getBool('callSwitch'); bool? callSw = prefs.getBool('callSwitch') ?? true;
bool? idleSw = prefs.getBool('idleSwitch'); bool? idleSw = prefs.getBool('idleSwitch') ?? true;
int? numberSet = prefs.getInt("numIndex") ?? 0; int? numberSet = prefs.getInt("numIndex") ?? 0;
List<String>? numberList = prefs.getStringList("addressList") ??[] ; List<String>? numberList = prefs.getStringList("addressList") ??[] ;
List<String>? noNumberList = prefs.getStringList("specified") ??[]; List<String>? noNumberList = prefs.getStringList("specified") ??[];
@ -86,7 +86,7 @@ void onStart(ServiceInstance service) async {
.sendSms(to: phoneNum!, message: con); .sendSms(to: phoneNum!, message: con);
} else { } else {
if (entry.first.duration! > 0) { if (entry.first.duration! > 0) {
if (callSw!) { if (callSw) {
print(callSw); print(callSw);
print("${phoneNum!}:${call!}"); print("${phoneNum!}:${call!}");
Telephony.backgroundInstance Telephony.backgroundInstance
@ -94,7 +94,7 @@ void onStart(ServiceInstance service) async {
} }
print("去电接听"); print("去电接听");
} else { } else {
if (idleSw!) { if (idleSw) {
print(idleSw); print(idleSw);
print("${phoneNum!}:${idle!}"); print("${phoneNum!}:${idle!}");
Telephony.backgroundInstance Telephony.backgroundInstance
@ -125,7 +125,7 @@ void onStart(ServiceInstance service) async {
.sendSms(to: phoneNum!, message: con); .sendSms(to: phoneNum!, message: con);
} else { } else {
if (entry.first.duration! > 0) { if (entry.first.duration! > 0) {
if (callSw!) { if (callSw) {
print(callSw); print(callSw);
print("${phoneNum!}:${call!}"); print("${phoneNum!}:${call!}");
Telephony.backgroundInstance Telephony.backgroundInstance
@ -133,7 +133,7 @@ void onStart(ServiceInstance service) async {
} }
print("去电接听"); print("去电接听");
} else { } else {
if (idleSw!) { if (idleSw) {
print(idleSw); print(idleSw);
print("${phoneNum!}:${idle!}"); print("${phoneNum!}:${idle!}");
Telephony.backgroundInstance Telephony.backgroundInstance
@ -164,7 +164,7 @@ void onStart(ServiceInstance service) async {
.sendSms(to: phoneNum!, message: con); .sendSms(to: phoneNum!, message: con);
} else { } else {
if (entry.first.duration! > 0) { if (entry.first.duration! > 0) {
if (callSw!) { if (callSw) {
print(callSw); print(callSw);
print("${phoneNum!}:${call!}"); print("${phoneNum!}:${call!}");
Telephony.backgroundInstance Telephony.backgroundInstance
@ -172,7 +172,7 @@ void onStart(ServiceInstance service) async {
} }
print("去电接听"); print("去电接听");
} else { } else {
if (idleSw!) { if (idleSw) {
print(idleSw); print(idleSw);
print("${phoneNum!}:${idle!}"); print("${phoneNum!}:${idle!}");
Telephony.backgroundInstance Telephony.backgroundInstance

@ -49,7 +49,7 @@ class _CallingIdleListState extends State<CallingIdleList>
List<String> textListSMS = []; List<String> textListSMS = [];
List<int> smsIdList = []; List<int> smsIdList = [];
int isCheck = 0; int isCheck = 0;
late bool val = false; late bool val = true;
@override @override
void initState() { void initState() {

@ -29,7 +29,8 @@ class _LoadingState extends State<Loading> {
Future.delayed(const Duration(milliseconds: 1000), () async { Future.delayed(const Duration(milliseconds: 1000), () async {
// await initialAll(); // await initialAll();
if (!await userProvider.init()) { if (!await userProvider.init()) {
await Get.offAll(() => const LoginPage()); // await Get.offAll(() => const LoginPage());
await Get.offAll(() => const TabNavigator());
// await Get.offAll(() => const LoginPage()); // await Get.offAll(() => const LoginPage());
} else { } else {
Navigator.of(context).pushReplacementNamed("/TabNavigator"); Navigator.of(context).pushReplacementNamed("/TabNavigator");

@ -23,7 +23,8 @@ import '../widget/image_scaffold.dart';
import '../widget/plone_bottom.dart'; import '../widget/plone_bottom.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
const LoginPage({Key? key}) : super(key: key); const
LoginPage({Key? key}) : super(key: key);
@override @override
_LoginPageState createState() => _LoginPageState(); _LoginPageState createState() => _LoginPageState();
@ -133,6 +134,7 @@ class _LoginPageState extends State<LoginPage> {
} else if (!_chooseAgreement) { } else if (!_chooseAgreement) {
BotToast.showText(text: "请同意并勾选隐私政策"); BotToast.showText(text: "请同意并勾选隐私政策");
} else { } else {
if (_lastTap != null && DateTime.now().difference(_lastTap!).inSeconds < 2) { if (_lastTap != null && DateTime.now().difference(_lastTap!).inSeconds < 2) {
// BotToast.showText(text: "过快"); // BotToast.showText(text: "过快");
return; return;

@ -34,7 +34,8 @@ class _TabNavigatorState extends State<TabNavigator>
// //Hive.initFlutter; // //Hive.initFlutter;
// await HiveStore.init(); // await HiveStore.init();
// }); // });
_pages = [const HomePage(), const TextMePage(),const UserPage()]; // , const TextMePage()
_pages = [const HomePage() , const TextMePage(),const UserPage()];
_tabController = TabController( _tabController = TabController(
length: _pages.length, vsync: this, initialIndex: widget.index ?? 0); length: _pages.length, vsync: this, initialIndex: widget.index ?? 0);
} }

@ -1,9 +1,12 @@
import 'dart:async';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_background_service/flutter_background_service.dart'; import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_update_dialog/update_dialog.dart';
import 'package:project_telephony/base/base_style.dart'; import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/login/login_page.dart'; import 'package:project_telephony/ui/login/login_page.dart';
@ -26,6 +29,7 @@ import '../../utils/toast/cloud_toast.dart';
import '../../utils/user_tool.dart'; import '../../utils/user_tool.dart';
import '../home/call.dart'; import '../home/call.dart';
import '../widget/appdialog.dart'; import '../widget/appdialog.dart';
import 'content_details_page.dart'; import 'content_details_page.dart';
class UserPage extends StatefulWidget { class UserPage extends StatefulWidget {
@ -179,6 +183,7 @@ class _UserPageState extends State<UserPage> {
? PloneBottom( ? PloneBottom(
border: false, border: false,
onTap: () async { onTap: () async {
// showDialog(context: context, builder: (_)=>UpdateDialog());
var cancel = CloudToast.loading; var cancel = CloudToast.loading;
var base = await apiClient.request( var base = await apiClient.request(
API.app.logout, API.app.logout,

@ -1,42 +1,62 @@
// import 'package:flutter/material.dart'; // import 'dart:async';
// import 'package:flutter_screenutil/flutter_screenutil.dart'; // import 'dart:ui';
// import 'package:project_telephony/utils/headers.dart'; //
// //
// class UpdateDialog extends Dialog { // import 'package:flutter_update_dialog/flutter_update_dialog.dart';
// @override //
// Widget build(BuildContext context) { // import '../../utils/toast/cloud_toast.dart';
// final String upDateContent; //
// final bool isForce; // UpdateDialog? dialog;
// return Center( //
// child: Column( // double progress = 0.0;
// mainAxisAlignment: MainAxisAlignment.center, //
// children: [ // void onUpdate() {
// SizedBox( // CloudToast.show('开始升级...');
// width: 640.w, // Timer.periodic(const Duration(milliseconds: 50), (Timer timer) {
// height: 740.w, // progress = progress + 0.02;
// child: Stack( // if (progress > 1.0001) {
// children: [ // timer.cancel();
// Image.asset( // dialog!.dismiss();
// Assets.images.cardbg.path, // progress = 0;
// fit: BoxFit.cover, // CloudToast.show('升级成功!');
// ), // } else {
// Container( // dialog!.update(progress);
// child: Column( // }
// children: [ // });
// Container( // }
// child: Text( //
// "发现新版本", // void defaultStyle() {
// style: TextStyle(fontSize: 32.w,color: Colors.), // if (dialog != null && dialog!.isShowing()) {
// ), // return;
// ) // }
// ], // dialog = UpdateDialog.showUpdate(context,
// ), // title: '是否升级到4.1.4版本?',
// ) // updateContent: '新版本大小:2.0M\n1.xxxxxxx\n2.xxxxxxx\n3.xxxxxxx',
// ], // onUpdate: onUpdate);
// ), // }
// ) //
// ], // void customStyle() {
// ), // if (dialog != null && dialog!.isShowing()) {
// ); // return;
// }
// dialog = UpdateDialog.showUpdate(context,
// width: 250,
// title: '是否升级到4.1.4版本?',
// updateContent: '新版本大小:2.0M\n1.xxxxxxx\n2.xxxxxxx\n3.xxxxxxx',
// titleTextSize: 14,
// contentTextSize: 12,
// buttonTextSize: 12,
// topImage: Image.asset('assets/bg_update_top.png'),
// extraHeight: 5,
// radius: 8,
// themeColor: const Color(0xFFFFAC5D),
// progressBackgroundColor: const Color(0x5AFFAC5D),
// isForce: true,
// updateButtonText: '升级',
// ignoreButtonText: '忽略此版本',
// enableIgnore: true, onIgnore: () {
// CloudToast.show('忽略');
// dialog!.dismiss();
// }, onUpdate: onUpdate);
// } // }
// } // }

@ -435,6 +435,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_update_dialog:
dependency: "direct main"
description:
name: flutter_update_dialog
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter_web_plugins: flutter_web_plugins:
dependency: transitive dependency: transitive
description: flutter description: flutter

@ -99,6 +99,8 @@ dependencies:
common_utils: ^2.1.0 common_utils: ^2.1.0
# 群发号码 # 群发号码
flutter_sms: ^2.3.3 flutter_sms: ^2.3.3
# 弹出框
flutter_update_dialog: ^2.0.0
## 生成适配器 ## 生成适配器
# hive_generator: ^1.1.3 # hive_generator: ^1.1.3
# # jdk # # jdk

Loading…
Cancel
Save