diff --git a/lib/ui/exclude/exclude_contacts_page.dart b/lib/ui/exclude/exclude_contacts_page.dart index ac194b7..ddd053a 100644 --- a/lib/ui/exclude/exclude_contacts_page.dart +++ b/lib/ui/exclude/exclude_contacts_page.dart @@ -14,6 +14,7 @@ class _ExcludeContactsPageState extends State { return ScaffoldThemeWidget( title: "从通讯录添加", bottom: "添加", + onTap: () { }, child: Container(), ); } 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 index 9bb9b30..55c59e2 100644 --- a/lib/ui/home/set/phone_num_list/call_records_list.dart +++ b/lib/ui/home/set/phone_num_list/call_records_list.dart @@ -1,6 +1,8 @@ - - +import 'package:call_log/call_log.dart'; import 'package:flutter/material.dart'; +import 'package:project_telephony/ui/widget/plone_bottom.dart'; +import 'package:project_telephony/utils/headers.dart'; +import 'package:velocity_x/velocity_x.dart'; import '../../../../model/phone_num_model.dart'; @@ -12,15 +14,36 @@ class CallRecordsList extends StatefulWidget { } class _CallRecordsListState extends State { - List phoneNum=[]; + List phoneNum = []; + List a = []; + int b = 0; @override Widget build(BuildContext context) { - return Container(); + return Column( + children: [ + Container( + width: 750.w, + height: 1000.w, + child: Text("") + + // ListView( + // children: [], + // ), + ), + PloneBottom(onTap: () async { + // Iterable entries = await CallLog.get(); + final Iterable entries = await CallLog.query(); + + var b = entries; + print("通话记录条数$b"); + }) + ], + ); } - // _getPhone(){ - // return ListView.builder(itemBuilder: (context,index){},itemCount: ,); - // } +// _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 c11d4ad..3ec0df1 100644 --- a/lib/ui/home/set/specify_phone_page.dart +++ b/lib/ui/home/set/specify_phone_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:project_telephony/ui/exclude/exclude_contacts_page.dart'; import 'package:project_telephony/ui/home/home_page.dart'; +import 'package:project_telephony/ui/home/set/phone_num_list/call_records_list.dart'; import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/ui/widget/plone_bottom.dart'; @@ -28,99 +29,225 @@ class _SpecifyPhonePageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - elevation: 0, - title: Text( - '发送号码设置', - style: TextStyle( - fontSize: BaseStyle.fontSize34, - color: BaseStyle.color333333, - fontWeight: FontWeight.bold), - ), - titleSpacing: 162.w, - leading: const CloudBackButton(isSpecial: true), - backgroundColor: kForeGroundColor), - backgroundColor: kForeGroundColor, - body: EasyRefresh( - firstRefresh: true, - controller: _refreshController, - header: MaterialHeader(), - // footer: MaterialFooter(), - onRefresh: () async { - // await userProvider.updateUserInfo(); + return ScaffoldThemeWidget(title: "发送号码设置", bottom: '添加', onTap: () { + showModalBottomSheet( + builder: (BuildContext context) { + return Container( + width: double.infinity, + height: 750.w, + padding: EdgeInsets.symmetric(horizontal: 32.w), + child: Column( + children: [ + 48.hb, + Text( + "添加号码", + style: TextStyle( + fontSize: 34.w, + fontWeight: FontWeight.bold), + ), + Expanded( + child: ListView( + children: [ + _getAddPhone("通话记录添加", "通过本机通话记录添加号码", () { + Get.to(() => ScaffoldThemeWidget( + bottom: '添加', + title: '从通话记录添加', + isBorder: true, + isOpacity: false, + onTap: () { }, + child: const CallRecordsList() + )); + }), + _getAddPhone("通迅录添加", "通过本机通讯录添加号码", () { + Get.to(() => (const ExcludeContactsPage())); + }), + _getAddPhone( + "添加单个或批量号码", "通过输入号码段添加批量号码", () {}), + ], + )), + PloneBottom( + onTap: () { + Navigator.pop(context); + }, + hPadding: 32, + border: true, + textColor: const Color(0xFF1890FF), + color2: const Color(0xFFF9F9F9), + color1: const Color(0xFFF9F9F9), + text: "取消", + ), + 32.hb + ], + ), + ); + }, + context: context); + }, + child: EasyRefresh( + firstRefresh: true, + controller: _refreshController, + header: MaterialHeader(), + // footer: MaterialFooter(), + onRefresh: () async { + // await userProvider.updateUserInfo(); - setState(() {}); - }, - child: ListView( - children: [ - _getNullList(), - PloneBottom( - onTap: () { - showModalBottomSheet( - builder: (BuildContext context) { - return Container( - width: double.infinity, - height: 750.w, - padding: EdgeInsets.symmetric(horizontal: 32.w), - child: Column( - children: [ - 48.hb, - Text( - "添加号码", - style: TextStyle( - fontSize: 34.w, - fontWeight: FontWeight.bold), - ), - Expanded( - 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())); - }), - _getAddPhone( - "添加单个或批量号码", "通过输入号码段添加批量号码", () {}), - ], - )), - PloneBottom( - onTap: () { - Navigator.pop(context); - }, - hPadding: 32, - border: true, - textColor: const Color(0xFF1890FF), - color2: const Color(0xFFF9F9F9), - color1: const Color(0xFFF9F9F9), - text: "取消", - ), - 32.hb - ], - ), - ); - }, - context: context); - }, - border: true, - color2: const Color(0xFF74BCFF), - color1: const Color(0xFF1890FF), - text: "添加", - ), - ], - )), - ); + setState(() {}); + }, + child: ListView( + children: [ + _getNullList(), + + ], + )),); + // PloneBottom( + // onTap: () { + // showModalBottomSheet( + // builder: (BuildContext context) { + // return Container( + // width: double.infinity, + // height: 750.w, + // padding: EdgeInsets.symmetric(horizontal: 32.w), + // child: Column( + // children: [ + // 48.hb, + // Text( + // "添加号码", + // style: TextStyle( + // fontSize: 34.w, + // fontWeight: FontWeight.bold), + // ), + // Expanded( + // child: ListView( + // children: [ + // _getAddPhone("通话记录添加", "通过本机通话记录添加号码", () { + // Get.to(() => ScaffoldThemeWidget( + // bottom: '添加', + // title: '从通话记录添加', + // isBorder: true, + // isOpacity: false, + // onTap: () { }, + // child: CallRecordsList() + // )); + // }), + // _getAddPhone("通迅录添加", "通过本机通讯录添加号码", () { + // Get.to(() => (const ExcludeContactsPage())); + // }), + // _getAddPhone( + // "添加单个或批量号码", "通过输入号码段添加批量号码", () {}), + // ], + // )), + // PloneBottom( + // onTap: () { + // Navigator.pop(context); + // }, + // hPadding: 32, + // border: true, + // textColor: const Color(0xFF1890FF), + // color2: const Color(0xFFF9F9F9), + // color1: const Color(0xFFF9F9F9), + // text: "取消", + // ), + // 32.hb + // ], + // ), + // ); + // }, + // context: context); + // }, + // border: true, + // color2: const Color(0xFF74BCFF), + // color1: const Color(0xFF1890FF), + // text: "添加", + // ), + // Scaffold( + // appBar: AppBar( + // elevation: 0, + // title: Text( + // '发送号码设置', + // style: TextStyle( + // fontSize: BaseStyle.fontSize34, + // color: BaseStyle.color333333, + // fontWeight: FontWeight.bold), + // ), + // titleSpacing: 162.w, + // leading: const CloudBackButton(isSpecial: true), + // backgroundColor: kForeGroundColor), + // backgroundColor: kForeGroundColor, + // body: EasyRefresh( + // firstRefresh: true, + // controller: _refreshController, + // header: MaterialHeader(), + // // footer: MaterialFooter(), + // onRefresh: () async { + // // await userProvider.updateUserInfo(); + // + // setState(() {}); + // }, + // child: ListView( + // children: [ + // _getNullList(), + // PloneBottom( + // onTap: () { + // showModalBottomSheet( + // builder: (BuildContext context) { + // return Container( + // width: double.infinity, + // height: 750.w, + // padding: EdgeInsets.symmetric(horizontal: 32.w), + // child: Column( + // children: [ + // 48.hb, + // Text( + // "添加号码", + // style: TextStyle( + // fontSize: 34.w, + // fontWeight: FontWeight.bold), + // ), + // Expanded( + // child: ListView( + // children: [ + // _getAddPhone("通话记录添加", "通过本机通话记录添加号码", () { + // Get.to(() => const ScaffoldThemeWidget( + // bottom: '添加', + // title: '从通话记录添加', + // isBorder: true, + // isOpacity: false, + // child: CallRecordsList() + // )); + // }), + // _getAddPhone("通迅录添加", "通过本机通讯录添加号码", () { + // Get.to(() => (const ExcludeContactsPage())); + // }), + // _getAddPhone( + // "添加单个或批量号码", "通过输入号码段添加批量号码", () {}), + // ], + // )), + // PloneBottom( + // onTap: () { + // Navigator.pop(context); + // }, + // hPadding: 32, + // border: true, + // textColor: const Color(0xFF1890FF), + // color2: const Color(0xFFF9F9F9), + // color1: const Color(0xFFF9F9F9), + // text: "取消", + // ), + // 32.hb + // ], + // ), + // ); + // }, + // context: context); + // }, + // border: true, + // color2: const Color(0xFF74BCFF), + // color1: const Color(0xFF1890FF), + // text: "添加", + // ), + // ], + // )), + // ); } _getAddPhone(String title, String text, VoidCallback widget) { diff --git a/lib/ui/widget/scaffold_theme_widget.dart b/lib/ui/widget/scaffold_theme_widget.dart index 1cbdbaf..ace58e1 100644 --- a/lib/ui/widget/scaffold_theme_widget.dart +++ b/lib/ui/widget/scaffold_theme_widget.dart @@ -22,9 +22,9 @@ class ScaffoldThemeWidget extends StatefulWidget { final String bottom; final bool isBorder; final bool isOpacity; - + final VoidCallback onTap; const ScaffoldThemeWidget( - {Key? key, required this.title, required this.child, required this.bottom, this.isBorder = false, this.isOpacity = true + {Key? key, required this.title, required this.child, required this.bottom, this.isBorder = false, this.isOpacity = true,required this.onTap }) : super(key: key); @@ -58,9 +58,7 @@ class _ScaffoldThemeWidgetState extends State { backgroundColor: Colors.white, body: widget.child, bottomNavigationBar: PloneBottom( - onTap: () async { - - }, + onTap: widget.onTap, border:widget.isBorder, opacity: widget.isOpacity ? 1 : 0.4, text: widget.bottom,