diff --git a/lib/model/phone_num_model.dart b/lib/model/phone_num_model.dart new file mode 100644 index 0000000..e1db27a --- /dev/null +++ b/lib/model/phone_num_model.dart @@ -0,0 +1,19 @@ +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +part 'phone_num_model.g.dart'; + + +@JsonSerializable() +class PhoneNumModel extends Equatable{ + final String num; + final int time; + factory PhoneNumModel.fromJson(Map json) =>_$PhoneNumModelFromJson(json); + + + const PhoneNumModel({ + required this.num, + required this.time, + }); + @override + List get props => [num,time,]; +} \ No newline at end of file diff --git a/lib/model/phone_num_model.g.dart b/lib/model/phone_num_model.g.dart new file mode 100644 index 0000000..755cfca --- /dev/null +++ b/lib/model/phone_num_model.g.dart @@ -0,0 +1,13 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'phone_num_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PhoneNumModel _$PhoneNumModelFromJson(Map json) => + PhoneNumModel( + num: json['num'] as String, + time: json['time'] as int, + ); diff --git a/lib/ui/home/call.dart b/lib/ui/home/call.dart index 9671503..0de9ebb 100644 --- a/lib/ui/home/call.dart +++ b/lib/ui/home/call.dart @@ -76,26 +76,26 @@ void onStart(ServiceInstance service) async { if (flag > 0) { print("来电拒接/未接"); print("${phoneNum!}:${ref!}"); - Telephony.backgroundInstance.sendSms(to: phoneNum!, message: ref!); + Telephony.backgroundInstance.sendSms(to: phoneNum!, message: ref); print("发送成功"); } else if(flag==-1){ print("来电接听"); print("${phoneNum!}:${con!}"); - Telephony.backgroundInstance.sendSms(to: phoneNum!, message: con!); + Telephony.backgroundInstance.sendSms(to: phoneNum!, message: con); } else { if(entry.first.duration!>0){ if(callSw!){ print(callSw); print("${phoneNum!}:${call!}"); - Telephony.backgroundInstance.sendSms(to: phoneNum!, message: call!); + Telephony.backgroundInstance.sendSms(to: phoneNum!, message: call); } print("去电接听"); }else{ if(idleSw!){ print(idleSw); print("${phoneNum!}:${idle!}"); - Telephony.backgroundInstance.sendSms(to: phoneNum!, message: idle!); + Telephony.backgroundInstance.sendSms(to: phoneNum!, message: idle); } print("去电未接"); } diff --git a/lib/ui/home/set/phone_num_list/call_records_list.dart b/lib/ui/home/set/phone_num_list/call_records_list.dart new file mode 100644 index 0000000..9bb9b30 --- /dev/null +++ b/lib/ui/home/set/phone_num_list/call_records_list.dart @@ -0,0 +1,26 @@ + + +import 'package:flutter/material.dart'; + +import '../../../../model/phone_num_model.dart'; + +class CallRecordsList extends StatefulWidget { + const CallRecordsList({Key? key}) : super(key: key); + + @override + _CallRecordsListState createState() => _CallRecordsListState(); +} + +class _CallRecordsListState extends State { + List phoneNum=[]; + + @override + Widget build(BuildContext context) { + return Container(); + } + + // _getPhone(){ + // return ListView.builder(itemBuilder: (context,index){},itemCount: ,); + // } + +} diff --git a/lib/ui/home/set/specify_phone_page.dart b/lib/ui/home/set/specify_phone_page.dart index 295bfe6..c11d4ad 100644 --- a/lib/ui/home/set/specify_phone_page.dart +++ b/lib/ui/home/set/specify_phone_page.dart @@ -8,6 +8,7 @@ import 'package:project_telephony/ui/widget/plone_bottom.dart'; import '../../../base/base_style.dart'; import '../../widget/plone_back_button.dart'; +import '../../widget/scaffold_theme_widget.dart'; class SpecifyPhonePage extends StatefulWidget { const SpecifyPhonePage({Key? key}) : super(key: key); @@ -75,10 +76,20 @@ class _SpecifyPhonePageState extends State { child: ListView( children: [ _getAddPhone("通话记录添加", "通过本机通话记录添加号码", () { - + Get.to(() => ScaffoldThemeWidget( + bottom: '添加', + title: '从通话记录添加', + isBorder: true, + isOpacity: false, + child: Container( + width: 100.w, + height: 100.w, + color: Colors.red, + ), + )); }), _getAddPhone("通迅录添加", "通过本机通讯录添加号码", () { - Get.to(()=>(const ExcludeContactsPage())); + Get.to(() => (const ExcludeContactsPage())); }), _getAddPhone( "添加单个或批量号码", "通过输入号码段添加批量号码", () {}), diff --git a/lib/ui/user/content_details_page.dart b/lib/ui/user/content_details_page.dart index 4e1a29a..4138539 100644 --- a/lib/ui/user/content_details_page.dart +++ b/lib/ui/user/content_details_page.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/user_tool.dart'; -import 'package:provider/provider.dart'; + import '../../base/base_style.dart'; import '../../constants/api.dart'; import '../../model/network/api_client.dart'; import '../../model/network/base_model.dart'; -import '../../providers/user_provider.dart'; + import '../../utils/toast/cloud_toast.dart'; import '../widget/plone_back_button.dart'; import '../widget/plone_bottom.dart'; diff --git a/lib/ui/widget/scaffold_theme_widget.dart b/lib/ui/widget/scaffold_theme_widget.dart index da33cfc..1cbdbaf 100644 --- a/lib/ui/widget/scaffold_theme_widget.dart +++ b/lib/ui/widget/scaffold_theme_widget.dart @@ -20,9 +20,12 @@ class ScaffoldThemeWidget extends StatefulWidget { final String title; final Widget child; final String bottom; + final bool isBorder; + final bool isOpacity; const ScaffoldThemeWidget( - {Key? key, required this.title, required this.child, required this.bottom}) + {Key? key, required this.title, required this.child, required this.bottom, this.isBorder = false, this.isOpacity = true + }) : super(key: key); @override @@ -58,6 +61,8 @@ class _ScaffoldThemeWidgetState extends State { onTap: () async { }, + border:widget.isBorder, + opacity: widget.isOpacity ? 1 : 0.4, text: widget.bottom, ).paddingOnly(bottom: 30.w), );