库包替换

master
王亚玲 2 years ago
parent d66244e002
commit da9a2a5549

@ -21,7 +21,7 @@ class API {
}
static const int networkTimeOut = 10000;
static String get baseURL => '$host';
static String get baseURL => host;
static _App app = _App();
static _Pay pay = _Pay();

@ -18,24 +18,24 @@ extension WidgetListExt on List<Widget> {
extension OddListExt<T> on List<T> {
List<T> oddList() {
List<T> _newList = [];
List<T> newList = [];
for (var element in this) {
if (indexOf(element).isEven) {
_newList.add(element);
newList.add(element);
}
}
return _newList;
return newList;
}
}
extension EvenListExt<T> on List<T> {
List<T> evenList() {
List<T> _newList = [];
List<T> newList = [];
forEach((element) {
if (indexOf(element).isOdd) {
_newList.add(element);
newList.add(element);
}
});
return _newList;
return newList;
}
}

@ -2,12 +2,12 @@
import 'dart:async';
import 'package:bot_toast/bot_toast.dart';
import 'package:call_log/call_log.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_sms/flutter_sms.dart';
import 'package:fluwx/fluwx.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';
import 'package:permission_handler/permission_handler.dart';
@ -16,22 +16,14 @@ import 'package:power_logger/power_logger.dart';
import 'package:project_telephony/providers/user_provider.dart';
import 'package:project_telephony/ui/home/call.dart';
import 'package:project_telephony/ui/home/call_sms.dart';
import 'package:project_telephony/ui/tab_navigator.dart';
import 'package:provider/provider.dart';
import 'package:telephony/telephony.dart';
import 'package:project_telephony/utils/hive_store.dart';
import 'package:workmanager/workmanager.dart';
// void _sendSMS(String message, List<String> recipients) async {
// try{
// String result =
// await sendSMS(message: message, recipients: recipients, sendDirect: true);
// print(result);
// } on PlatformException catch(e){
// print(e.toString());
// }
// }
@ -63,7 +55,6 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> {
final telephony = Telephony.instance;
@override
Future<void> _Getpermission() async{
await [Permission.sms,Permission.phone,].request();
}

@ -1,4 +1,4 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';

@ -12,10 +12,10 @@ class LoginModel {
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['message'] = this.message;
data['token'] = this.token;
data['status'] = this.status;
final Map<String, dynamic> data = <String, dynamic>{};
data['message'] = message;
data['token'] = token;
data['status'] = status;
return data;
}
}

@ -5,7 +5,7 @@ import '../model/hive/ContentHive.dart';
class ContentListModel extends ChangeNotifier{
late Box _regionBox;
List<ContentHive> _regions=[];
final List<ContentHive> _regions=[];
List<ContentHive> get regions=>_regions;
Future init() async{}
// _regionBox = await Hive.openBox("ContentListBox");

@ -1,37 +1,16 @@
import 'dart:async';
import 'dart:io';
import 'dart:ui';
import 'package:call_log/call_log.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:flutter_sms/flutter_sms.dart';
import 'package:project_telephony/ui/user/user_page.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:telephony/telephony.dart';
//
// Future<void> _sendSMS(String message, List<String> recipients) async {
// await sendSMS(message: message, recipients: recipients, sendDirect: true);
// // try{
// // String result =
// // await sendSMS(message: message, recipients: recipients, sendDirect: true);
// // print(result);
// // } catch (error){
// // print(error.toString());
// // }
//
// }
Future<void> initializeService() async {
SharedPreferences preferences = await SharedPreferences.getInstance();
// SharedPreferences preferences = await SharedPreferences.getInstance();
final service = FlutterBackgroundService();
await service.configure(

@ -71,7 +71,7 @@ class _ContentDetailsPageState extends State<ContentDetailsPage> {
},
onChanged: (text) {
content = text;
print(content);
// print(content);
setState(() {});
},
style: TextStyle(

@ -141,13 +141,4 @@ class _ContentPageState extends State<ContentPage> {
),
);
}
void _sendSMS(String message, List<String> recipients) async {
String _result = await sendSMS(
message: message, recipients: recipients, sendDirect: true)
.catchError((onError) {
print(onError);
});
print(_result);
}
}

@ -1,10 +1,10 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_sms/flutter_sms.dart';
import 'package:project_telephony/ui/user/user_page.dart';
import 'package:project_telephony/utils/headers.dart';
import 'home/call.dart';
import 'home/home_page.dart';
class TabNavigator extends StatefulWidget {

@ -1,7 +1,7 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/user/members_page.dart';
import 'package:project_telephony/ui/widget/check_radio.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
@ -9,8 +9,7 @@ import 'package:project_telephony/ui/widget/putup_widget.dart';
import 'package:project_telephony/utils/headers.dart';
import 'package:tobias/tobias.dart';
import 'package:fluwx/fluwx.dart' as fluwx;
import '../../model/pay/wx_pay_model.dart';
import '../../utils/pay_util.dart';
class MembersPage extends StatefulWidget {
const MembersPage({Key? key}) : super(key: key);
@ -87,7 +86,7 @@ class _MembersPageState extends State<MembersPage> {
}else{
aliPay("paySign").then((payResult) {
// map["paySign"]
print("支付宝:" + payResult.toString());
print("支付宝:$payResult");
if (payResult['resultStatus'] == '9000') {
Get.snackbar('提示', "充值成功");
} else {

@ -79,14 +79,12 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
return ListTile(
onTap: ()async{
if(!(sms && plone)){
print(sms);
print(plone);
// print(sms);
// print(plone);
openAppSettings();
}else{
print("123123123123");
// print("123123123123");
}
// await Permission.phone.request();
// await Permission.sms.request();
// Map<Permission, PermissionStatus> statuses = await [
@ -95,12 +93,12 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
// ].request();
//
// openAppSettings();
print(await Permission.phone.request().isGranted);
print(await Permission.sms.request().isGranted);
// print(await Permission.phone.request().isGranted);
// print(await Permission.sms.request().isGranted);
},
title: Text(
'获取设备来电',
// style: Theme.of(context).textTheme.titleMedium,
style: Theme.of(context).textTheme.titleMedium,
),
subtitle: const Text(
"获取设备",

@ -1,31 +1,28 @@
import 'dart:async';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:permission_handler_platform_interface/permission_handler_platform_interface.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/login/login_page.dart';
import 'package:project_telephony/ui/tab_navigator.dart';
import 'package:project_telephony/ui/user/members_page.dart';
import 'package:project_telephony/ui/user/privacy_rights_page.dart';
import 'package:project_telephony/ui/widget/image_scaffold.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
import 'package:project_telephony/ui/widget/plone_image_picker.dart';
import 'package:project_telephony/utils/headers.dart';
import 'package:project_telephony/utils/permissionutils.dart';
import 'package:provider/provider.dart';
import 'package:telephony/telephony.dart';
import 'package:workmanager/workmanager.dart';
import '../../constants/api.dart';
import '../../model/network/api_client.dart';
import '../../permission.dart';
import '../../providers/user_provider.dart';
import '../../utils/toast/cloud_toast.dart';
import '../../utils/user_tool.dart';
import '../home/call.dart';
import '../home/content_details_page.dart';
import '../home/home_page.dart';
@ -239,7 +236,6 @@ class _UserPageState extends State<UserPage> {
//
_getSwitch(String url, String name, bool pd) {
num a=0;
return GestureDetector(
onTap: () async {
pd
@ -277,28 +273,12 @@ class _UserPageState extends State<UserPage> {
value: vle,
onChanged: (value) async{
vle=value;
print(vle);
if(vle) {
Telephony.backgroundInstance.sendSms(to: "13395740386", message: "啦啦啦啦啦");
// Workmanager().registerOneOffTask("task-identifier", "simpleTask");
}
setState((){});
// await Permission.phone.request();
// List<Permission> permissions = [
// Permission.sms,
// Permission.phone,
// ];
// PermissionHelper.check(permissions, onSuccess: () {
// print('onSuccess');
// }, onFailed: () {
// print('onFailed');
// }, onOpenSetting: () {
// print('onOpenSetting');
// openAppSettings();
// });
// setState(() {
// vle = value;
// });
})
: const Icon(Icons.keyboard_arrow_right)),
),

@ -1,5 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:project_telephony/utils/headers.dart';
class Centertipsalterwidget extends StatefulWidget {
@ -23,8 +23,8 @@ class _CentertipsalterwidgetState extends State<Centertipsalterwidget> {
height: 10.w,
),
Align(
child: Text(widget.desText),
alignment: const Alignment(0, 0),
child: Text(widget.desText),
)
]),
actions: [

@ -1025,9 +1025,11 @@ packages:
telephony:
dependency: "direct main"
description:
name: telephony
url: "https://pub.dartlang.org"
source: hosted
path: "."
ref: HEAD
resolved-ref: a7f9c11a4e2f5fb1dac1058c0c96435d31f29a29
url: "https://git.oa00.com/wylyl22/telephony.git"
source: git
version: "0.2.0"
term_glyph:
dependency: transitive
@ -1183,13 +1185,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.2"
workmanager:
dependency: "direct main"
description:
name: workmanager
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
xdg_directories:
dependency: transitive
description:
@ -1212,5 +1207,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=2.17.0-206.0.dev <3.0.0"
flutter: ">=2.8.0"

@ -34,14 +34,16 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
telephony: ^0.2.0
telephony:
git:
url: https://git.oa00.com/wylyl22/telephony.git
## 获取来电状态
# provider: ^6.0.3
# 获取通话记录
call_log: ^4.0.0
permission_handler: ^10.0.0
# 后台设置
workmanager: ^0.5.0
flutter_background_service: ^2.1.3
flutter_background_service_android: ^2.0.3
device_info_plus: any

@ -14,7 +14,7 @@ import 'package:project_telephony/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);

Loading…
Cancel
Save