|
|
@ -1,12 +1,9 @@
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.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 '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 {
|
|
|
|
class ExcludeSinglePage extends StatefulWidget {
|
|
|
|
const ExcludeSinglePage({Key? key}) : super(key: key);
|
|
|
|
const ExcludeSinglePage({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
@ -15,96 +12,114 @@ class ExcludeSinglePage extends StatefulWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _ExcludeSinglePageState extends State<ExcludeSinglePage> {
|
|
|
|
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
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
return ScaffoldThemeWidget(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: '添加单个或批量号码',
|
|
|
|
elevation: 0,
|
|
|
|
bottom: "添加",
|
|
|
|
title: Text(
|
|
|
|
onTap: () {},
|
|
|
|
'添加单个或批量号码',
|
|
|
|
isOpacity:
|
|
|
|
style: TextStyle(
|
|
|
|
_phoneController.text.isNotEmpty && _nameController.text.isNotEmpty,
|
|
|
|
fontSize: BaseStyle.fontSize34,
|
|
|
|
child: Container(
|
|
|
|
color: BaseStyle.color333333,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
titleSpacing: 110.w,
|
|
|
|
|
|
|
|
leading: const CloudBackButton(isSpecial: true),
|
|
|
|
|
|
|
|
backgroundColor: kForeGroundColor),
|
|
|
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
|
|
|
body: Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(top: 25.h, left: 50.w, right: 50.w),
|
|
|
|
padding: EdgeInsets.only(top: 25.h, left: 50.w, right: 50.w),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
addNumber("号码", "请输入号码"),
|
|
|
|
addNumber("号码", "请输入号码", _phoneController),
|
|
|
|
40.hb,
|
|
|
|
15.heightBox,
|
|
|
|
addNumber("名称", "请输入名称"),
|
|
|
|
addNumber("名称", "请输入名称", _nameController),
|
|
|
|
43.hb,
|
|
|
|
30.heightBox,
|
|
|
|
Text(
|
|
|
|
RichText(
|
|
|
|
"使用说明:",
|
|
|
|
text: const TextSpan(
|
|
|
|
style: TextStyle(color: BaseStyle.color999999, fontSize: 28.sp),
|
|
|
|
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(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontSize: 16,
|
|
|
|
color: Colors.black38,
|
|
|
|
color: Color(0xFF999999),
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
15.heightBox,
|
|
|
|
15.heightBox,
|
|
|
|
CupertinoTextField(
|
|
|
|
TextField(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 20.w),
|
|
|
|
controller: controller,
|
|
|
|
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,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
onChanged: (value) {
|
|
|
|
if(title=="号码"){
|
|
|
|
|
|
|
|
phone=value;
|
|
|
|
|
|
|
|
print("phone:$phone");
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
name=value;
|
|
|
|
|
|
|
|
print("name:$name");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
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
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|