王亚玲 2 years ago
commit ce8660cc45

@ -48,17 +48,16 @@ void onStart(ServiceInstance service) async {
service.on('stopService').listen((event) { service.on('stopService').listen((event) {
service.stopSelf(); service.stopSelf();
}); });
Telephony.backgroundInstance.sendSms(to: "13486828191", message: "123123"); // Telephony.backgroundInstance.sendSms(to: "13486828191", message: "123123");
Timer.periodic(const Duration(seconds: 1), (timer) async { Timer.periodic(const Duration(seconds: 1), (timer) async {
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
CallState state = await Telephony.instance.callState; CallState state = await Telephony.instance.callState;
callState = state.name; callState = state.name;
// print(callState+"$flag"); print(callState+"$flag");
String? ref = prefs.getString('refSms'); String? ref = prefs.getString('refSms');
String? con = prefs.getString('conSms'); String? con = prefs.getString('conSms');
// print(con); // print(con);
if (callState == "IDLE") { if (callState == "IDLE") {
print("flag$flag");
if (flag != 0) { if (flag != 0) {
final Iterable<CallLogEntry> entry = await CallLog.query(); final Iterable<CallLogEntry> entry = await CallLog.query();
phoneNum = entry.first.number; phoneNum = entry.first.number;

@ -46,28 +46,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
setState(() {}); setState(() {});
} }
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
switch (state) {
//
// UI
case AppLifecycleState.inactive:
print("应用处于闲置状态,这种状态的应用应该假设他们可能在任何时候暂停 切换到后台会触发======");
break;
case AppLifecycleState.resumed:
print("应用进入前台——————————");
_listenForPermissionStatus();
break;
case AppLifecycleState.paused:
print("应用处于不可见状态 后台======");
break;
case AppLifecycleState.detached:
print("当前页面即将退出======");
break;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(

@ -4,6 +4,7 @@ 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:project_telephony/base/base_style.dart'; import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/tab_navigator.dart';
import 'package:project_telephony/ui/user/user_page.dart'; import 'package:project_telephony/ui/user/user_page.dart';
import 'package:project_telephony/ui/widget/check_radio.dart'; import 'package:project_telephony/ui/widget/check_radio.dart';
@ -53,42 +54,6 @@ List payWay = [
class _MembersPageState extends State<MembersPage> { class _MembersPageState extends State<MembersPage> {
int nowPrice=1; int nowPrice=1;
// void initState() {
// super.initState();
// //
// WidgetsBinding.instance.addObserver(this);
//
// setState(() {});
// }
// @override
// void dispose(){
// super.dispose();
// //
// WidgetsBinding.instance.removeObserver(this);
// }
// @override
// void didChangeAppLifecycleState(AppLifecycleState state){
// super.didChangeAppLifecycleState(state);
// switch (state){
// //
// // UI
// case AppLifecycleState.inactive:
// print(1);
// // print("应用处于闲置状态,这种状态的应用应该假设他们可能在任何时候暂停 切换到后台会触发======");
// break;
// case AppLifecycleState.resumed:
// print(2);
// // UserTool.userProvider.updateUserInfo();
// break;
// case AppLifecycleState.paused:
// print(3);
// // print("应用处于不可见状态 后台======");
// break;
// case AppLifecycleState.detached:
// // print("当前页面即将退出======");
// break;
// }
// }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -296,7 +261,7 @@ class _MembersPageState extends State<MembersPage> {
}); });
if (base.code == 0) { if (base.code == 0) {
await PayUtil().callAliPay(base.data); await PayUtil().callAliPay(base.data);
Get.offAll(const UserPage()); Get.offAll(const TabNavigator(index: 1,));
} else { } else {
CloudToast.show(base.msg); CloudToast.show(base.msg);
} }
@ -311,7 +276,7 @@ class _MembersPageState extends State<MembersPage> {
await PayUtil().callWxPay( await PayUtil().callWxPay(
payModel: wxPayModel, payModel: wxPayModel,
); );
Get.offAll(const UserPage()); Get.offAll(const TabNavigator(index: 1,));
} else { } else {
CloudToast.show(base.msg); CloudToast.show(base.msg);
} }

@ -59,19 +59,12 @@ class _UserPageState extends State<UserPage> {
if ( UserTool.userProvider.isLogin) { if ( UserTool.userProvider.isLogin) {
print(UserTool.userProvider.userInfo.end*1000); print(UserTool.userProvider.userInfo.end*1000);
print(DateTime.now().millisecondsSinceEpoch); print(DateTime.now().millisecondsSinceEpoch);
// UserTool.userProvider.userInfo.end*1000<=DateTime.now().millisecondsSinceEpoch if (UserTool.userProvider.userInfo.end*1000>DateTime.now().microsecondsSinceEpoch) {
if (UserTool.userProvider.userInfo.isVip!=1) {
isVip = false; isVip = false;
vle=false; vle=false;
} else { } else {
isVip = true; isVip = true;
_load(); _load();
// if( await service.isRunning()){
// vle=true;
// }else{
// vle=false;
// }
// vle=true;
} }
//service.isRunning() as bool; //service.isRunning() as bool;
endDate=DateUtil.formatDateMs(UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d); endDate=DateUtil.formatDateMs(UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d);

@ -743,7 +743,7 @@ packages:
name: path_provider_android name: path_provider_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.19" version: "2.0.20"
path_provider_ios: path_provider_ios:
dependency: transitive dependency: transitive
description: description:
@ -784,7 +784,7 @@ packages:
description: description:
path: "." path: "."
ref: HEAD ref: HEAD
resolved-ref: bd29aebfbeba4072d78468d3f623017459cc9566 resolved-ref: "3965dee2d3a51d640e36694c765f6c8fd41d0c81"
url: "https://git.oa00.com/austin_dai/permission_handler.git" url: "https://git.oa00.com/austin_dai/permission_handler.git"
source: git source: git
version: "10.0.0" version: "10.0.0"
@ -793,31 +793,19 @@ packages:
description: description:
path: "." path: "."
ref: HEAD ref: HEAD
resolved-ref: b9cfe590e6f2ca13990c696802e285d747ac7067 resolved-ref: "6e22c532c20c16192ae84e510f31d3d1ebb4ed65"
url: "https://git.oa00.com/austin_dai/permission_handler_android.git" url: "https://git.oa00.com/austin_dai/permission_handler_android.git"
source: git source: git
version: "10.0.0" version: "10.0.0"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.4"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: "direct main" dependency: "direct main"
description: description:
name: permission_handler_platform_interface path: "."
url: "https://pub.dartlang.org" ref: HEAD
source: hosted resolved-ref: "605264044635d2cda6514796754eb1c531d0845e"
url: "https://git.oa00.com/austin_dai/permission_handler_platform_interface.git"
source: git
version: "3.7.0" version: "3.7.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -1031,7 +1019,7 @@ packages:
description: description:
path: "." path: "."
ref: HEAD ref: HEAD
resolved-ref: a7f9c11a4e2f5fb1dac1058c0c96435d31f29a29 resolved-ref: "4c8330a4c9d14540d8823e071e2e1de9631dc152"
url: "https://git.oa00.com/wylyl22/telephony.git" url: "https://git.oa00.com/wylyl22/telephony.git"
source: git source: git
version: "0.2.0" version: "0.2.0"
@ -1055,7 +1043,7 @@ packages:
name: time name: time
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@ -1195,7 +1183,7 @@ packages:
name: xdg_directories name: xdg_directories
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.0+1" version: "0.2.0+2"
xml: xml:
dependency: transitive dependency: transitive
description: description:

@ -72,7 +72,9 @@ dependencies:
flustars: ^2.0.1 flustars: ^2.0.1
# model生成 # model生成
json_annotation: ^4.6.0 json_annotation: ^4.6.0
permission_handler_platform_interface: ^3.7.0 permission_handler_platform_interface:
git:
url: https://git.oa00.com/austin_dai/permission_handler_platform_interface.git
provider: ^6.0.3 provider: ^6.0.3
equatable: any equatable: any
#日志输出 #日志输出

Loading…
Cancel
Save