|
|
|
@ -1,12 +1,9 @@
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:project_telephony/utils/headers.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
import 'package:project_telephony/ui/widget/scaffold_theme_widget.dart';
|
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
import '../../base/base_style.dart';
|
|
|
|
|
import '../widget/plone_back_button.dart';
|
|
|
|
|
import '../widget/plone_bottom.dart';
|
|
|
|
|
|
|
|
|
|
class ExcludeSinglePage extends StatefulWidget {
|
|
|
|
|
const ExcludeSinglePage({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
@ -15,96 +12,114 @@ class ExcludeSinglePage extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ExcludeSinglePageState extends State<ExcludeSinglePage> {
|
|
|
|
|
late TextEditingController _phoneController;
|
|
|
|
|
late TextEditingController _nameController;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
_phoneController = TextEditingController();
|
|
|
|
|
_nameController = TextEditingController();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
super.dispose();
|
|
|
|
|
_phoneController.dispose();
|
|
|
|
|
_nameController.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String phone="";
|
|
|
|
|
String name="";
|
|
|
|
|
@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: 110.w,
|
|
|
|
|
leading: const CloudBackButton(isSpecial: true),
|
|
|
|
|
backgroundColor: kForeGroundColor),
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
body: Container(
|
|
|
|
|
return ScaffoldThemeWidget(
|
|
|
|
|
title: '添加单个或批量号码',
|
|
|
|
|
bottom: "添加",
|
|
|
|
|
onTap: () {},
|
|
|
|
|
isOpacity:
|
|
|
|
|
_phoneController.text.isNotEmpty && _nameController.text.isNotEmpty,
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.only(top: 25.h, left: 50.w, right: 50.w),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
addNumber("号码", "请输入号码"),
|
|
|
|
|
40.hb,
|
|
|
|
|
addNumber("名称", "请输入名称"),
|
|
|
|
|
43.hb,
|
|
|
|
|
Text(
|
|
|
|
|
"使用说明:",
|
|
|
|
|
style: TextStyle(color: BaseStyle.color999999, fontSize: 28.sp),
|
|
|
|
|
addNumber("号码", "请输入号码", _phoneController),
|
|
|
|
|
15.heightBox,
|
|
|
|
|
addNumber("名称", "请输入名称", _nameController),
|
|
|
|
|
30.heightBox,
|
|
|
|
|
RichText(
|
|
|
|
|
text: const TextSpan(
|
|
|
|
|
children: [
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: "使用说明:\n",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Colors.black38,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: "如输入000*,可屏蔽所有000开头的号码",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black38,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
12.hb,
|
|
|
|
|
Text("如输入00852*,可匹配所有00852开头的号码",
|
|
|
|
|
style: TextStyle(color: BaseStyle.color999999, fontSize: 28.sp))
|
|
|
|
|
// RichText(
|
|
|
|
|
// text: const TextSpan(
|
|
|
|
|
// children: [
|
|
|
|
|
// TextSpan(text: "使用说明:"),
|
|
|
|
|
// TextSpan(text: "如输入000*,可屏蔽所有000开头的号码")
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomNavigationBar: PloneBottom(
|
|
|
|
|
onTap: (){},
|
|
|
|
|
border: name.isEmpty || phone.isEmpty,
|
|
|
|
|
opacity:name.isEmpty || phone.isEmpty ? 0.4 : 1,
|
|
|
|
|
text: "添加",
|
|
|
|
|
).paddingOnly(bottom: 30.w),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addNumber(String title, content) {
|
|
|
|
|
addNumber(String title, content, TextEditingController controller) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 28.sp,
|
|
|
|
|
color: Colors.black38,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: Color(0xFF999999),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
15.heightBox,
|
|
|
|
|
CupertinoTextField(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 20.w),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(color: Colors.white),
|
|
|
|
|
// borderRadius: BorderRadius.all(
|
|
|
|
|
// Radius.circular(4.w)
|
|
|
|
|
// ),
|
|
|
|
|
color: const Color(0xFFF9F9F9)),
|
|
|
|
|
placeholderStyle:
|
|
|
|
|
TextStyle(color: BaseStyle.color999999, fontSize: 28.sp),
|
|
|
|
|
placeholder: content,
|
|
|
|
|
TextField(
|
|
|
|
|
controller: controller,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
if(title=="号码"){
|
|
|
|
|
phone=value;
|
|
|
|
|
print("phone:$phone");
|
|
|
|
|
}else{
|
|
|
|
|
name=value;
|
|
|
|
|
print("name:$name");
|
|
|
|
|
}
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
contentPadding: EdgeInsets.all(30.w),
|
|
|
|
|
hintText: content,
|
|
|
|
|
hintStyle: const TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(0xFF999999),
|
|
|
|
|
),
|
|
|
|
|
fillColor: const Color(0xFFF9F9F9),
|
|
|
|
|
filled: true,
|
|
|
|
|
enabledBorder: const OutlineInputBorder(
|
|
|
|
|
/*边角*/
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(5), //边角为5
|
|
|
|
|
),
|
|
|
|
|
borderSide: BorderSide(
|
|
|
|
|
color: Colors.white, //边线颜色为白色
|
|
|
|
|
width: 1, //边线宽度为2
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: const OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(
|
|
|
|
|
color: Colors.white, //边框颜色为白色
|
|
|
|
|
width: 1, //宽度为5
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(5), //边角为30
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|