# Conflicts:
#	lib/ui/widget/appdialog.dart
master
戴余标 2 years ago
commit 33e19f8d3d

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -34,6 +34,14 @@ class $AssetsIconsGen {
AssetGenImage get mySelected => AssetGenImage get mySelected =>
const AssetGenImage('assets/icons/my_selected.png'); const AssetGenImage('assets/icons/my_selected.png');
/// File path: assets/icons/notxlphone.png
AssetGenImage get notxlphone =>
const AssetGenImage('assets/icons/notxlphone.png');
/// File path: assets/icons/nullphonelist.png
AssetGenImage get nullphonelist =>
const AssetGenImage('assets/icons/nullphonelist.png');
/// File path: assets/icons/permissions.png /// File path: assets/icons/permissions.png
AssetGenImage get permissions => AssetGenImage get permissions =>
const AssetGenImage('assets/icons/permissions.png'); const AssetGenImage('assets/icons/permissions.png');
@ -44,15 +52,29 @@ class $AssetsIconsGen {
/// File path: assets/icons/right.png /// File path: assets/icons/right.png
AssetGenImage get right => const AssetGenImage('assets/icons/right.png'); AssetGenImage get right => const AssetGenImage('assets/icons/right.png');
/// File path: assets/icons/rylyphone.png
AssetGenImage get rylyphone =>
const AssetGenImage('assets/icons/rylyphone.png');
/// File path: assets/icons/set.png
AssetGenImage get set => const AssetGenImage('assets/icons/set.png');
/// File path: assets/icons/sms.png /// File path: assets/icons/sms.png
AssetGenImage get sms => const AssetGenImage('assets/icons/sms.png'); AssetGenImage get sms => const AssetGenImage('assets/icons/sms.png');
/// File path: assets/icons/switch1.png /// File path: assets/icons/switch1.png
AssetGenImage get switch1 => const AssetGenImage('assets/icons/switch1.png'); AssetGenImage get switch1 => const AssetGenImage('assets/icons/switch1.png');
/// File path: assets/icons/txlphone.png
AssetGenImage get txlphone =>
const AssetGenImage('assets/icons/txlphone.png');
/// File path: assets/icons/weixin.png /// File path: assets/icons/weixin.png
AssetGenImage get weixin => const AssetGenImage('assets/icons/weixin.png'); AssetGenImage get weixin => const AssetGenImage('assets/icons/weixin.png');
/// File path: assets/icons/zdphone.png
AssetGenImage get zdphone => const AssetGenImage('assets/icons/zdphone.png');
/// File path: assets/icons/zhifubao.png /// File path: assets/icons/zhifubao.png
AssetGenImage get zhifubao => AssetGenImage get zhifubao =>
const AssetGenImage('assets/icons/zhifubao.png'); const AssetGenImage('assets/icons/zhifubao.png');

@ -7,6 +7,7 @@ import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:project_telephony/ui/home/content_connect_page.dart'; import 'package:project_telephony/ui/home/content_connect_page.dart';
import 'package:project_telephony/ui/home/content_refuse_page.dart'; import 'package:project_telephony/ui/home/content_refuse_page.dart';
import 'package:project_telephony/ui/home/set/phone_set_page.dart';
import 'package:project_telephony/ui/user/privacy_rights_page.dart'; import 'package:project_telephony/ui/user/privacy_rights_page.dart';
import 'package:project_telephony/ui/widget/appdialog.dart'; import 'package:project_telephony/ui/widget/appdialog.dart';
@ -26,13 +27,12 @@ class HomePage extends StatefulWidget {
bool sms = false; bool sms = false;
bool plone = false; bool plone = false;
bool kg=false; bool kg = false;
final service = FlutterBackgroundService(); final service = FlutterBackgroundService();
@override @override
class _HomePageState extends State<HomePage> with WidgetsBindingObserver { class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -124,20 +124,18 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
offstage: (sms && plone && callLog && kg), offstage: (sms && plone && callLog && kg),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
if(!(sms && plone && callLog && kg)){ if (!(sms && plone && callLog && kg)) {
if(!(sms && plone && callLog )){ if (!(sms && plone && callLog)) {
Get.to(()=>const PrivacyRightsPage(name: "权限说明")); Get.to(() => const PrivacyRightsPage(name: "权限说明"));
// Get.to(()=>const TabNavigator(index: 1,)); // Get.to(()=>const TabNavigator(index: 1,));
}else{ } else {
BotToast.showText(text: '功能开关未开启'); BotToast.showText(text: '功能开关未开启');
} }
} }
// print(); // print();
// openAppSettings(); // openAppSettings();
}, },
child: child: Container(
Container(
width: 622.w, width: 622.w,
margin: EdgeInsets.symmetric(horizontal: 64.w), margin: EdgeInsets.symmetric(horizontal: 64.w),
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w),
@ -155,17 +153,21 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
), ),
16.wb, 16.wb,
Text( Text(
!(sms && plone && callLog ) ? "必须权限没有授予本APP无法正常使用":"功能开关未开启,请到我的页面开启", !(sms && plone && callLog)
? "必须权限没有授予本APP无法正常使用"
: "功能开关未开启,请到我的页面开启",
style: style:
TextStyle(color: const Color(0xFFFF3F3F), fontSize: 24.sp), TextStyle(color: const Color(0xFFFF3F3F), fontSize: 24.sp),
), ),
!(sms && plone && callLog ) ?32.wb: 0.wb, !(sms && plone && callLog) ? 32.wb : 0.wb,
!(sms && plone && callLog )? Image( !(sms && plone && callLog)
image: AssetImage(Assets.icons.right.path), ? Image(
width: 28.w, image: AssetImage(Assets.icons.right.path),
height: 28.w, width: 28.w,
fit: BoxFit.fill, height: 28.w,
):const SizedBox() fit: BoxFit.fill,
)
: const SizedBox()
], ],
), ),
), ),
@ -186,12 +188,14 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
color: const Color(0xFF333333), color: const Color(0xFF333333),
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
8.hb, 24.hb,
Text( Text(
"希望能成为您的短信小助手", "希望能成为您的短信小助手",
style: TextStyle(fontSize: 32.sp, color: const Color(0xFF999999)), style: TextStyle(fontSize: 32.sp, color: const Color(0xFF999999)),
), ),
50.hb, 48.hb,
_getSet(),
32.hb,
_getContainer("接听后", "编辑接听后发送的短信内容", Assets.images.answer.path, _getContainer("接听后", "编辑接听后发送的短信内容", Assets.images.answer.path,
const Color(0xFF74BCFF), const Color(0xFF1890FF)), const Color(0xFF74BCFF), const Color(0xFF1890FF)),
30.hb, 30.hb,
@ -202,6 +206,44 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
); );
} }
_getSet() {
return GestureDetector(
onTap: (){
Get.to(()=>const PhoneSetPage());
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 42.w, vertical: 20.w),
decoration: BoxDecoration(
color: const Color(0xFFF2F9FF),
border: Border.all(color: const Color(0xFF1890FF), width: 2.w),
borderRadius: BorderRadius.circular(16.w)),
child: Row(
children: [
SizedBox(
width: 48.w,
height: 48.w,
child: Image.asset(Assets.icons.set.path),
),
16.wb,
Text(
"短信发送号码设置",
style: TextStyle(fontSize: 28.sp, color: const Color(0xFF1890FF)),
),
190.wb,
SizedBox(
width: 48.w,
height: 48.w,
child: const Icon(
Icons.chevron_right,
color: Color(0xFF1890FF),
),
),
],
),
),
);
}
_getContainer(String title, String text, String image, Color cl1, Color cl2) { _getContainer(String title, String text, String image, Color cl1, Color cl2) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {

@ -0,0 +1,158 @@
import 'package:flutter/material.dart';
import 'package:project_telephony/ui/home/set/specify_phone_page.dart';
import 'package:project_telephony/utils/headers.dart';
import '../../../base/base_style.dart';
import '../../widget/plone_back_button.dart';
// class setItem{
//
// }
class PhoneSetPage extends StatefulWidget {
const PhoneSetPage({Key? key}) : super(key: key);
@override
_PhoneSetPageState createState() => _PhoneSetPageState();
}
class _PhoneSetPageState extends State<PhoneSetPage> {
int select = 0;
List setList = [
{
"icon": Assets.icons.rylyphone.path,
"title": "任意来源号码发送",
"text": "所有的号码来电都会发送",
// "select": true,
},
{
"icon": Assets.icons.txlphone.path,
"title": "在通讯录中的号码发送",
"text": "只给在通讯录中的号码来电发送",
// "select": false,
},
{
"icon": Assets.icons.notxlphone.path,
"title": "不在通讯录中的号码发送",
"text": "只给不在通讯录中的号码来电发送",
// "select": false,
},
];
@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: Column(
children: [
_getList(),
24.hb,
GestureDetector(
onTap: () {
Get.to(()=>const SpecifyPhonePage());
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 30.w),
height: 144.w,
child: ListTile(
leading: SizedBox(
width: 72.w,
height: 72.w,
child: Image.asset(
Assets.icons.zdphone.path,
fit: BoxFit.fill,
),
),
title: Text(
"指定号码不发送",
style:
TextStyle(fontSize: 32.sp, fontWeight: FontWeight.bold),
),
subtitle: Text(
"通过添加指定号码来设置不发送",
style: TextStyle(
fontSize: 28.sp, color: const Color(0xFF999999)),
),
trailing: SizedBox(
width: 48.w,
height: 48.w,
child: const Icon(Icons.arrow_forward_ios),
)),
),
)
],
),
);
}
_getList() {
return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 30.w),
height: 500.w,
child: ListView.builder(
itemBuilder: (context, index) {
return _getListBox(setList, index);
},
itemCount: setList.length,
),
);
}
_getListBox(List item, int index) {
return GestureDetector(
onTap: () {
select = index;
// print(_selectIndex);
setState(() {});
},
child: ListTile(
leading: SizedBox(
width: 72.w,
height: 72.w,
child: Image.asset(
item[index]["icon"],
fit: BoxFit.fill,
)),
title: Text(
item[index]["title"],
style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.bold),
),
subtitle: Text(
item[index]["text"],
style: TextStyle(fontSize: 28.sp, color: const Color(0xFF999999)),
),
trailing: SizedBox(
width: 40.w,
height: 40.w,
child: Radio(
onChanged: (int? value) {
select = index;
// print(_selectIndex);
setState(() {});
},
groupValue: select,
value: index,
),
),
// BeeCheckRadio(
// value: index,
// groupValue: [select],
// ),
),
);
}
}

@ -0,0 +1,158 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:project_telephony/ui/home/home_page.dart';
import 'package:project_telephony/utils/headers.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
import '../../../base/base_style.dart';
import '../../widget/plone_back_button.dart';
class SpecifyPhonePage extends StatefulWidget {
const SpecifyPhonePage({Key? key}) : super(key: key);
@override
_SpecifyPhonePageState createState() => _SpecifyPhonePageState();
}
class _SpecifyPhonePageState extends State<SpecifyPhonePage> {
final EasyRefreshController _refreshController = EasyRefreshController();
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@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();
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("通话记录添加", "通过本机通话记录添加号码", () {
}),
_getAddPhone("通迅录添加", "通过本机通讯录添加号码", () {}),
_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) {
return GestureDetector(
onTap: widget,
child: ListTile(
title: Text(
title,
style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.bold),
),
subtitle: Text(
text,
style: TextStyle(fontSize: 28.sp, color: BaseStyle.color999999),
),
trailing: const Icon(Icons.chevron_right),
),
);
}
_getNullList() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
490.hb,
Image.asset(
Assets.icons.nullphonelist.path,
width: 240.w,
height: 212.w,
fit: BoxFit.fill,
),
48.hb,
Text(
"这里是空的",
style: TextStyle(
color: const Color(0xFF999999),
fontWeight: FontWeight.bold,
fontSize: 36.sp),
),
16.hb,
Text(
"还没有添加指定号码",
style: TextStyle(color: const Color(0xFF999999), fontSize: 28.sp),
),
490.hb,
],
);
}
}

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_background_service/flutter_background_service.dart'; import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:project_telephony/base/base_style.dart'; import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/login/login_page.dart'; import 'package:project_telephony/ui/login/login_page.dart';
import 'package:project_telephony/ui/tab_navigator.dart'; import 'package:project_telephony/ui/tab_navigator.dart';
@ -20,14 +20,14 @@ import 'package:telephony/telephony.dart';
import '../../constants/api.dart'; import '../../constants/api.dart';
import '../../model/network/api_client.dart'; import '../../model/network/api_client.dart';
import '../../providers/user_provider.dart'; import '../../providers/user_provider.dart';
import '../../utils/hive_store.dart';
import '../../utils/toast/cloud_toast.dart'; import '../../utils/toast/cloud_toast.dart';
import '../../utils/user_tool.dart'; import '../../utils/user_tool.dart';
import '../home/call.dart'; import '../home/call.dart';
import '../widget/appdialog.dart'; import '../widget/appdialog.dart';
import 'content_details_page.dart'; import 'content_details_page.dart';
import '../home/home_page.dart';
class UserPage extends StatefulWidget { class UserPage extends StatefulWidget {
const UserPage({Key? key}) : super(key: key); const UserPage({Key? key}) : super(key: key);

@ -12,6 +12,7 @@ class PloneBottom extends StatefulWidget {
final bool blM; // final bool blM; //
final bool border; // final bool border; //
final double opacity; final double opacity;
final int hPadding;
const PloneBottom({ const PloneBottom({
Key? key, Key? key,
this.text = '返回首页', this.text = '返回首页',
@ -21,6 +22,7 @@ class PloneBottom extends StatefulWidget {
this.blM = true, this.blM = true,
this.border = false, this.border = false,
this.opacity = 1, this.opacity = 1,
this.hPadding=64,
required this.onTap, required this.onTap,
}); });
@ -40,7 +42,7 @@ class _PloneBottomState extends State<PloneBottom> {
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 14.w), padding: EdgeInsets.symmetric(vertical: 14.w),
margin: widget.blM margin: widget.blM
? EdgeInsets.symmetric(horizontal: 64.w) ? EdgeInsets.symmetric(horizontal: widget.hPadding.w)
: EdgeInsets.only(left: 0.w), : EdgeInsets.only(left: 0.w),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(

Loading…
Cancel
Save