diff --git a/lib/ui/home/call.dart b/lib/ui/home/call.dart index 16df61b..5e17a0b 100644 --- a/lib/ui/home/call.dart +++ b/lib/ui/home/call.dart @@ -5,6 +5,7 @@ import 'package:call_log/call_log.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_background_service/flutter_background_service.dart'; +import 'package:flutter_background_service_android/flutter_background_service_android.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:telephony/telephony.dart'; @@ -40,7 +41,6 @@ bool onIosBackground(ServiceInstance service) { } void onStart(ServiceInstance service) async { - DartPluginRegistrant.ensureInitialized(); int flag = 0; String? phoneNum = ""; int? callRecords = 0; diff --git a/pubspec.lock b/pubspec.lock index ef32a10..6119083 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -331,16 +331,20 @@ packages: flutter_background_service: dependency: "direct main" description: - name: flutter_background_service - url: "https://pub.dartlang.org" - source: hosted + path: "." + ref: HEAD + resolved-ref: ee40fe3df73119bc7064e34d36fc7d8a0194e651 + url: "https://git.oa00.com/austin_dai/flutter_background_service.git" + source: git version: "2.1.3" flutter_background_service_android: dependency: "direct main" description: - name: flutter_background_service_android - url: "https://pub.dartlang.org" - source: hosted + path: "." + ref: HEAD + resolved-ref: "63a2277119558ed55de1098b5c05040ef9ff845d" + url: "https://git.oa00.com/austin_dai/flutter_background_service_android.git" + source: git version: "2.0.3" flutter_background_service_ios: dependency: transitive diff --git a/pubspec.yaml b/pubspec.yaml index ac52680..90de2fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,8 +44,12 @@ dependencies: git: url: https://git.oa00.com/austin_dai/permission_handler.git # 后台设置 - flutter_background_service: ^2.1.3 - flutter_background_service_android: ^2.0.3 + flutter_background_service: + git: + url: https://git.oa00.com/austin_dai/flutter_background_service.git + flutter_background_service_android: + git: + url: https://git.oa00.com/austin_dai/flutter_background_service_android.git device_info_plus: any # 屏幕适配 flutter_screenutil: ^5.5.3+2