You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
3.8 KiB

2 years ago
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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';
class ExcludeSinglePage extends StatefulWidget {
const ExcludeSinglePage({Key? key}) : super(key: key);
@override
_ExcludeSinglePageState createState() => _ExcludeSinglePageState();
}
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();
}
2 years ago
@override
Widget build(BuildContext context) {
return ScaffoldThemeWidget(
2 years ago
wid: 110,
2 years ago
title: '添加单个或批量号码',
bottom: "添加",
onTap: () {},
isOpacity:
_phoneController.text.isNotEmpty && _nameController.text.isNotEmpty,
2 years ago
child: Container(
padding: EdgeInsets.only(top: 25.h, left: 50.w, right: 50.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
addNumber("号码", "请输入号码", _phoneController),
2 years ago
15.heightBox,
addNumber("名称", "请输入名称", _nameController),
30.heightBox,
2 years ago
RichText(
text: const TextSpan(
children: [
TextSpan(
text: "使用说明:\n",
style: TextStyle(
fontWeight: FontWeight.w600,
color: Colors.black38,
),
),
2 years ago
TextSpan(
text: "如输入000*可屏蔽所有000开头的号码",
style: TextStyle(
color: Colors.black38,
),
),
2 years ago
],
),
),
],
),
),
);
}
addNumber(String title, content, TextEditingController controller) {
2 years ago
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
2 years ago
style: TextStyle(
fontSize: 28.sp,
color: const Color(0xFF999999),
fontWeight: FontWeight.w500,
2 years ago
),
),
15.heightBox,
TextField(
controller: controller,
onChanged: (value) {
setState(() {});
},
2 years ago
decoration: InputDecoration(
contentPadding: EdgeInsets.all(30.w),
2 years ago
hintText: content,
2 years ago
hintStyle: TextStyle(
fontSize: 28.sp,
// fontWeight: FontWeight.w600,
color: const 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
),
2 years ago
),
),
),
],
);
}
}