master
王亚玲 2 years ago
parent db379a3bda
commit f021eaad20

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

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

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

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

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

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

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

@ -23,7 +23,8 @@ import '../widget/image_scaffold.dart';
import '../widget/plone_bottom.dart';
class LoginPage extends StatefulWidget {
const LoginPage({Key? key}) : super(key: key);
const
LoginPage({Key? key}) : super(key: key);
@override
_LoginPageState createState() => _LoginPageState();
@ -133,6 +134,7 @@ class _LoginPageState extends State<LoginPage> {
} else if (!_chooseAgreement) {
BotToast.showText(text: "请同意并勾选隐私政策");
} else {
if (_lastTap != null && DateTime.now().difference(_lastTap!).inSeconds < 2) {
// BotToast.showText(text: "过快");
return;
@ -143,7 +145,7 @@ class _LoginPageState extends State<LoginPage> {
'code': _smsCodeController.text
});
if (base.code == 0) {
await UserTool.userProvider.setToken(base.data['token']);
await UserTool.userProvider.setToken(base.data['token']);
Get.offAll(const TabNavigator());
} else {
CloudToast.show(base.msg);

@ -34,7 +34,8 @@ class _TabNavigatorState extends State<TabNavigator>
// //Hive.initFlutter;
// await HiveStore.init();
// });
_pages = [const HomePage(), const TextMePage(),const UserPage()];
// , const TextMePage()
_pages = [const HomePage() , const TextMePage(),const UserPage()];
_tabController = TabController(
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:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_background_service/flutter_background_service.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/ui/login/login_page.dart';
@ -26,6 +29,7 @@ import '../../utils/toast/cloud_toast.dart';
import '../../utils/user_tool.dart';
import '../home/call.dart';
import '../widget/appdialog.dart';
import 'content_details_page.dart';
class UserPage extends StatefulWidget {
@ -179,6 +183,7 @@ class _UserPageState extends State<UserPage> {
? PloneBottom(
border: false,
onTap: () async {
// showDialog(context: context, builder: (_)=>UpdateDialog());
var cancel = CloudToast.loading;
var base = await apiClient.request(
API.app.logout,

@ -1,42 +1,62 @@
// import 'package:flutter/material.dart';
// import 'package:flutter_screenutil/flutter_screenutil.dart';
// import 'package:project_telephony/utils/headers.dart';
//
// class UpdateDialog extends Dialog {
// @override
// Widget build(BuildContext context) {
// final String upDateContent;
// final bool isForce;
// return Center(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// SizedBox(
// width: 640.w,
// height: 740.w,
// child: Stack(
// children: [
// Image.asset(
// Assets.images.cardbg.path,
// fit: BoxFit.cover,
// ),
// Container(
// child: Column(
// children: [
// Container(
// child: Text(
// "发现新版本",
// style: TextStyle(fontSize: 32.w,color: Colors.),
// ),
// )
// ],
// ),
// )
// ],
// ),
// )
// ],
// ),
// );
// import 'dart:async';
// import 'dart:ui';
//
//
// import 'package:flutter_update_dialog/flutter_update_dialog.dart';
//
// import '../../utils/toast/cloud_toast.dart';
//
// UpdateDialog? dialog;
//
// double progress = 0.0;
//
// void onUpdate() {
// CloudToast.show('开始升级...');
// Timer.periodic(const Duration(milliseconds: 50), (Timer timer) {
// progress = progress + 0.02;
// if (progress > 1.0001) {
// timer.cancel();
// dialog!.dismiss();
// progress = 0;
// CloudToast.show('升级成功!');
// } else {
// dialog!.update(progress);
// }
// });
// }
//
// void defaultStyle() {
// 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
source: sdk
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:
dependency: transitive
description: flutter

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

Loading…
Cancel
Save