短信帮手

dyb
王亚玲 2 years ago
parent a034c5c9f5
commit 53e05e0f62

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 11 KiB

@ -6,6 +6,7 @@ import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';
import 'package:project_telephony/ui/login/login_page.dart';
import 'package:project_telephony/ui/tab_navigator.dart';
import 'package:telephony/telephony.dart';
@ -13,13 +14,13 @@ onBackgroundMessage(SmsMessage message) {
debugPrint("onBackgroundMessage called");
}
Future<void> main() async {
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await initializeService();
runApp(const MyApp());
SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle(
statusBarColor: Colors.transparent, //
statusBarIconBrightness: Brightness.dark); //
// SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle(
// statusBarColor: Colors.transparent, //
// statusBarIconBrightness: Brightness.dark); //
}
Future<void> initializeService() async {
@ -135,7 +136,7 @@ class _MyAppState extends State<MyApp> {
child: GetMaterialApp(
// get.testmode=true,
debugShowCheckedModeBanner: false,
home: LoginPage(),
home: TabNavigator(),
// supportedLocales: [Locale('zh')],
// locale: Locale('zh'),
// builder: ( context,child){

@ -5,40 +5,110 @@ import '../../base/base_style.dart';
import '../widget/plone_back_button.dart';
import '../widget/plone_bottom.dart';
typedef TextCallback = Function(String textContent);
class ContentDetailsPage extends StatefulWidget {
const ContentDetailsPage({Key? key}) : super(key: key);
final TextCallback ploneBack;
final String content;
const ContentDetailsPage(
{Key? key, required this.content, required this.ploneBack})
: super(key: key);
@override
_ContentDetailsPageState createState() => _ContentDetailsPageState();
}
String content = "";
class _ContentDetailsPageState extends State<ContentDetailsPage> {
late TextEditingController _controller;
@override
void initState() {
super.initState();
_controller = TextEditingController(text: widget.content);
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
elevation: 0,
title: Text(
'选择短信内容',
style: Theme.of(context).textTheme.headline6,
'编辑短信内容',
style: TextStyle(
fontSize: BaseStyle.fontSize34,
color: BaseStyle.color333333,
fontWeight: FontWeight.bold),
),
titleSpacing: 162.w,
leading: const CloudBackButton(isSpecial: true),
backgroundColor: kForeGroundColor
),
backgroundColor: kForeGroundColor),
backgroundColor: Colors.white,
body: _getBox(),
);
}
_getBox(){
_getBox() {
return Column(children: [
Container(
width: 622.w,
height: 960.w,
decoration: BoxDecoration(color: BaseStyle.colorcccccc,borderRadius: BorderRadius.circular(16)),
margin: EdgeInsets.only(left: 32.w,right: 32.w,top: 32.w,bottom: 298.w),
child: const Text('请输入短信内容'),),
PloneBottom(onTap: (){
decoration: BoxDecoration(
color: const Color(0xFFF9F9F9),
borderRadius: BorderRadius.circular(16.w)),
margin: EdgeInsets.only(top: 32.w, bottom: 298.w),
child: Container(
// color: kForeGroundColor,
margin: EdgeInsets.symmetric(horizontal: 40.w, vertical: 50.w),
child: TextField(
maxLines: 100,
keyboardType: TextInputType.text,
onEditingComplete: () {
setState(() {});
// _refreshController.callRefresh();
},
onChanged: (text) {
content = text;
print(content);
setState(() {});
},
style: TextStyle(
color: BaseStyle.color333333,
fontSize: BaseStyle.fontSize28,
),
controller: _controller,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
filled: true,
isDense: true,
fillColor: Colors.white,
hintText: widget.content != "" ? "" : "请输入短信内容",
hintStyle: TextStyle(
color: widget.content != ""
? const Color(0xFF333333)
: Colors.grey.shade500,
fontSize: 28.sp,
fontWeight: FontWeight.bold),
border: InputBorder.none,
),
),
),
},text: "保存",)
// Text(widget.content,),
),
PloneBottom(
border: !content.isNotEmpty,
opacity: content.isNotEmpty ? 1 : 0.4,
onTap: () {
setState(() {});
widget.ploneBack(content);
Get.back();
// print(content);
},
text: "保存",
)
]);
}
}

@ -1,22 +1,28 @@
import 'package:flutter/material.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/home/content_details_page.dart';
import 'package:project_telephony/ui/widget/centertipsalterwidget.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart';
class ContentPage extends StatefulWidget {
const ContentPage({Key? key}) : super(key: key);
final bool? isAnswer; //truefalse
const ContentPage({Key? key, required this.isAnswer}) : super(key: key);
@override
_ContentPageState createState() => _ContentPageState();
}
class _ContentPageState extends State<ContentPage> {
List<String> textList = ['欢迎你的来电', '祝您生活愉快', '感谢您的来电我们会尽快处理的'];
int _select = 0;
List<String> textList = ['欢迎你的来电', '祝您生活愉快', '感谢您的来电我们会尽快处理的', '自定义短信内容'];
List<String> textList1 = ['自定义短信内容'];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
title: Text(
'选择短信内容',
style: Theme.of(context).textTheme.headline6,
@ -24,12 +30,11 @@ class _ContentPageState extends State<ContentPage> {
leading: const CloudBackButton(isSpecial: true),
backgroundColor: kForeGroundColor,
),
backgroundColor: Colors.white,
body: Column(children: [
Expanded(
child: _getList(),
),
_getBox2("自定义短信内容"),
32.hb
]),
);
}
@ -37,50 +42,69 @@ class _ContentPageState extends State<ContentPage> {
_getList() {
return ListView.builder(
itemBuilder: (context, index) {
return _getBox(textList[index], index == 0);
return _getBox(textList[index], index == _select, index);
},
itemCount: textList.length,
);
}
_getBox(String content, bool pd) {
return Container(
width: 686.w,
height: 122.w,
margin: EdgeInsets.only(top: 32.w, left: 32.w, right: 32.w),
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 30.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: pd ? Colors.blue : Colors.white,
),
child: Text(content,
style: TextStyle(
fontSize: BaseStyle.fontSize28,
color: pd ? const Color(0xFFF9F9F9) : BaseStyle.color333333)),
);
_getBox(String content, bool pd, int index) {
return GestureDetector(
onTap: () async {
_select = index;
if (index != textList.length - 1) {
await Get.to(() => ContentDetailsPage(
content: content,
ploneBack: (String textContent) {
textList1.add(textContent);
},
));
} else {
await Get.to(() => ContentDetailsPage(
content: "",
ploneBack: (String textContent) {
// print("这是数据" + textContent);
textList.setAll(index, {textContent});
},
));
setState(() {});
}
// print("这是数据" + textList[_s lect]);
_getBox2(
String content,
) {
return GestureDetector(
onTap: () {
Get.to(() => const ContentDetailsPage());
// print(index);
},
onLongPress: () {
setState(() {});
showDialog(
context: context,
builder: (context) {
return const Centertipsalterwidget(
desText: '你确定要删除这个短信模版吗,删除之后无法还原。',
title: '删除短信模板',
);
});
},
child: Container(
width: 686.w,
height: 122.w,
margin: EdgeInsets.only(top: 32.w, left: 32.w, right: 32.w),
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 30.w),
// width: 686.w,
height: 135.w,
margin: EdgeInsets.only(top: 32.w, left: 64.w, right: 64.w),
padding: EdgeInsets.only(left: 40.w, top: 50.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: Colors.white,
color: pd
? widget.isAnswer!
? Colors.blue
: Color(0xFF72E4C8)
: const Color(0xFFF9F9F9),
),
child: Text(
content,
style: TextStyle(
fontSize: BaseStyle.fontSize28, color: const Color(0xFF000000)),
)),
fontSize: BaseStyle.fontSize28,
color: pd ? const Color(0xFFF9F9F9) : BaseStyle.color333333,
fontWeight: FontWeight.bold),
),
),
);
}
}

@ -14,31 +14,34 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Column(
extendBodyBehindAppBar: true,
extendBody: true,
body: SafeArea(
child: Column(
children: [
Container(
//margin:EdgeInsets.symmetric(horizontal: 32.w,vertical: 16.w),
child: Image.asset(
Assets.images.homeBg.path,
height: 722.w,
width: 722.w,
)),
12.hb,
_getBody(),
],
),
);
));
}
_getBody() {
return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w),
padding: EdgeInsets.symmetric(horizontal: 64.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"短信",
"短信",
style: TextStyle(
fontSize: 64.sp,
color: Colors.black,
color: const Color(0xFF333333),
fontWeight: FontWeight.bold),
),
32.hb,
@ -62,12 +65,19 @@ class _HomePageState extends State<HomePage> {
onTap: () {
print(title);
if (title == "接听后") {
Get.to(() => const ContentPage());
// print("接听");
Get.to(() => const ContentPage(
isAnswer: true,
));
} else {
Get.to(() => const ContentPage(
isAnswer: false,
));
print("未接听");
}
},
child: Stack(
children: [
Align(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w),
@ -75,11 +85,18 @@ class _HomePageState extends State<HomePage> {
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [cl1, cl2])),
width: 622.w,
height: 192.w,
),
),
Positioned(
child: Row(
children: [
Container(
width: 532.w,
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w),
padding: EdgeInsets.only(
left: 48.w,
top: 35.w,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -92,21 +109,42 @@ class _HomePageState extends State<HomePage> {
Text(
text,
style: TextStyle(
fontSize: 28.sp,
fontSize: 27.sp,
color: const Color(0xFFFFFFFF).withOpacity(0.6)),
)
),
],
),
),
45.wb,
Image.asset(
image,
width: 108.w,
height: 66.h,
)
// Padding(
// padding: EdgeInsets.only(top: 40.w),
// child:
// )
],
),
),
Positioned(
bottom: 0,
right: 0,
child: Image.asset(
image,
width: 166.w,
height: 152.w,
fit: BoxFit.fill,
),
)
],
)
// Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(16.w),
// gradient: LinearGradient(
// end: Alignment.centerLeft,
// begin: Alignment.centerRight,
// colors: [cl1, cl2])),
// child:
// ),
);
}
}

@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart';
import '../../base/base_style.dart';
@ -56,13 +57,10 @@ class _LoginPageState extends State<LoginPage> {
children: [
Padding(
padding: EdgeInsets.only(top: 88.w, left: 8.w),
child: const Icon(
CupertinoIcons.chevron_back,
color: Colors.black,
),
child: const CloudBackButton(isSpecial: true),
),
Padding(
padding: EdgeInsets.only(left: 239.w, top: 88.w),
padding: EdgeInsets.only(left: 186.w, top: 88.w),
child: Text(
"登录/注册",
style: TextStyle(
@ -74,7 +72,7 @@ class _LoginPageState extends State<LoginPage> {
),
extendBody: true,
body: Container(
padding: EdgeInsets.only(left: 64.w, right: 64.w, top: 138.w),
padding: EdgeInsets.only(left: 64.w, right: 64.w, top: 124.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -91,10 +89,11 @@ class _LoginPageState extends State<LoginPage> {
style: TextStyle(fontSize: 32.sp, color: const Color(0xFF999999)),
),
80.hb,
_phoneTFWidget(),
_codeWidget(),
_getBox('+86', 36),
_getBox('验证码', 32),
112.hb,
PloneBottom(
blM: false,
onTap: () {
Get.to(() => const TabNavigator());
},
@ -107,135 +106,69 @@ class _LoginPageState extends State<LoginPage> {
),
);
}
//
_phoneTFWidget() {
_getBox(String text, int fontSize) {
return Container(
alignment: Alignment.centerLeft,
// padding: EdgeInsets.symmetric(horizontal: 72.w),
height: 40 * 2.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: TextField(
onChanged: (String phone) {
// setState(() {
// if (phone.length >= 11) {
// _getCodeEnable = true;
// } else {
// _getCodeEnable = false;
// }
// if (kDebugMode) {
// //print(_loginEnable);
// }
// });
},
// enabled: false,
controller: _phoneController,
// focusNode: _phoneFocusNode,
keyboardType: TextInputType.number,
style: TextStyle(
fontSize: 36.sp, color: const Color(0xFF999999)),
inputFormatters: [
LengthLimitingTextInputFormatter(11),
],
cursorColor: Colors.black,
decoration: InputDecoration(
// contentPadding: EdgeInsets.only(
// left: rSize(10), top: rSize(13)),
// prefixIcon: Container(
// // padding: EdgeInsets.only(right: 10.w),
// width: 50.w,
// alignment: Alignment.centerLeft,
// child: Text(
// "+86",
// style: TextStyle(
// fontSize: 32.sp,
// color: const Color(0xFF000000)),
// ),
// ),
prefixText: "+86",
prefixStyle: TextStyle(
color: Colors.black,
),
enabledBorder: const UnderlineInputBorder(
//
borderSide: BorderSide(
color: Color(0xffdddddd),
),
),
// focusedBorder: const UnderlineInputBorder( //
// borderSide: BorderSide(
// color: Color(0x19000000)
// ),
// ),
//border: InputBorder.none,
hintText:
"请输入手机号", // hintText: _phone.replaceFirst(RegExp(r'\d{4}'), '****', 3),
hintStyle: TextStyle(
color: const Color(0xFFCCCCCC), fontSize: 32.sp),
suffixIcon: GestureDetector(
onTap: () {},
// onTap: !_getCodeEnable
// ? () {}
// : () async {
// // await apiClient
// // .request(API.login.phoneCode, data: {
// // 'phone':
// // UserTool.userProvider.userInfo.phone,
// // });
// _beginCountDown();
// if (_cantSelected) return;
// _cantSelected = true;
// Future.delayed(const Duration(seconds: 1),
// () {
// _cantSelected = false;
// });
// },
child: Container(
width: 180.w,
alignment: Alignment.centerRight,
color: Colors.transparent,
child: const Text("获取验证码"
// _countDownStr,
// style: TextStyle(
// color: _getCodeEnable
// ? kPrimaryColor
// : BaseStyle.colorcccccc),
height: 144.w,
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 48.w),
decoration: BoxDecoration(
// color: Colors.black12,
border: Border(
bottom: BorderSide(color: const Color(0xFFE8E8E8), width: 1.w),
),
),
)),
child: Row(children: [
SizedBox(
width: 112.w,
child: Text(
text,
style: TextStyle(
fontSize: fontSize.sp,
color: BaseStyle.color333333,
fontWeight: FontWeight.bold),
),
),
],
Container(
width: 2.w,
height: 48.w,
margin: EdgeInsets.symmetric(horizontal: 32.w),
color: const Color(0xFFE8E8E8),
),
_phoneTFWidget(),
]),
);
}
//
_phoneTFWidget() {
return SizedBox(
// alignment: Alignment.centerLeft,
// padding: EdgeInsets.symmetric(horizontal: 72.w),
width: 300.w,
height: 50.w,
child: TextField(
maxLength: 11,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(r'[0-9]'))],
textCapitalization: TextCapitalization.none,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(bottom: 20.w),
border: InputBorder.none,
counterText: "",
//textfieldiOSplaceholder
hintText: "请输入手机号",
//
hintStyle: TextStyle(color: Colors.black12),
),
//_bottomLineWidget(),
],
),
);
}
//
_codeWidget() {
return Container(
alignment: Alignment.centerLeft,
//margin: EdgeInsets.symmetric(horizontal: 20.w),
// padding: EdgeInsets.symmetric(horizontal: 72.w),
height: 40 * 2.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
return SizedBox(
width: 300.w,
height: 50.w,
child: TextField(
onChanged: (String phone) {
setState(() {});
@ -243,8 +176,7 @@ class _LoginPageState extends State<LoginPage> {
controller: _smsCodeController,
// focusNode: _smsCodeFocusNode,
keyboardType: TextInputType.number,
style: TextStyle(
fontSize: 36.sp, color: BaseStyle.color999999),
style: TextStyle(fontSize: 36.sp, color: BaseStyle.color999999),
inputFormatters: [
LengthLimitingTextInputFormatter(4),
],
@ -271,16 +203,8 @@ class _LoginPageState extends State<LoginPage> {
),
),
hintText: "请输入验证码",
hintStyle: TextStyle(
color: BaseStyle.colorcccccc, fontSize: 36.sp),
hintStyle: TextStyle(color: BaseStyle.colorcccccc, fontSize: 36.sp),
)),
),
],
),
),
//_bottomLineWidget(),
],
),
);
}

@ -1,19 +1,21 @@
import 'package:flutter/material.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/widget/check_radio.dart';
// import 'package:project_telephony/ui/widget/check_radio.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
import 'package:project_telephony/ui/widget/putup_widget.dart';
import 'package:project_telephony/utils/headers.dart';
class MembersPage extends StatelessWidget {
MembersPage({Key? key}) : super(key: key);
ChooseItems? _chooseItem;
List<dynamic>? data;
final List<ChooseItems> _piceList = [
class MembersPage extends StatefulWidget {
const MembersPage({Key? key}) : super(key: key);
@override
_MembersPageState createState() => _MembersPageState();
}
ChooseItems? _chooseItem;
List<dynamic>? data;
final List<ChooseItems> _piceList = [
ChooseItems(
month: 12,
pice: 10,
@ -22,15 +24,17 @@ class MembersPage extends StatelessWidget {
month: 1,
pice: 1,
),
];
int _selectIndex = 0;
List payWay = [
];
int _selectIndex = 0;
List payWay = [
{
'payName': '微信支付',
'payUrl': Assets.icons.weixin.path,
},
{'payName': '支付宝支付', 'payUrl': Assets.icons.zhifubao.path}
];
];
class _MembersPageState extends State<MembersPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
@ -82,37 +86,10 @@ class MembersPage extends StatelessWidget {
],
)),
],
));
),
);
}
// _get() {
// return Stack(
// children: [
// Align(
// child: SizedBox(
// width: 750.w,
// height: 1410.w,
// ),
// ),
// Positioned(
// child: _getBanner(),
// ),
// Positioned(
// top: 224.w,
// child: Container(
// height: 1140.w,
// width: 750.w,
// decoration: const BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(20),
// topRight: Radius.circular(20))),
// child: Column(children: []),
// ))
// ],
// );
// }
//banner
_getBanner() {
return SizedBox(
@ -201,7 +178,8 @@ class MembersPage extends StatelessWidget {
mainAxisSpacing: 20.w,
callback: (item, index) {
_chooseItem = item;
// setState(() {});
// print(_piceList[index].pice);
setState(() {});
},
pickItem: _chooseItem,
),
@ -224,7 +202,8 @@ class MembersPage extends StatelessWidget {
return GestureDetector(
onTap: () {
_selectIndex = index;
// setState(() {});
// print(_selectIndex);
setState(() {});
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 40.w),

@ -0,0 +1,79 @@
import 'package:flutter/material.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart';
class PrivacyRightsPage extends StatefulWidget {
final String name;
const PrivacyRightsPage({Key? key, required this.name}) : super(key: key);
@override
_PrivacyRightsPageState createState() => _PrivacyRightsPageState();
}
class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
title: Text(
widget.name,
style: TextStyle(
fontSize: BaseStyle.fontSize34,
color: BaseStyle.color333333,
fontWeight: FontWeight.bold),
),
titleSpacing: 162.w,
leading: const CloudBackButton(isSpecial: true),
backgroundColor: kForeGroundColor),
backgroundColor: Colors.white,
body: widget.name == "隐私政策" ? null : _getRights(true),
);
}
_getRights(bool pd) {
return GestureDetector(
onTap: () {},
child: Container(
height: 144.w,
width: 750.w,
padding: EdgeInsets.symmetric(horizontal: 64.w, vertical: 17.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'获取设备来电',
style: TextStyle(
fontSize: 32.sp,
color: BaseStyle.color333333,
fontWeight: FontWeight.bold),
),
16.hb,
Text('用于获取设备',
style: TextStyle(
fontSize: 28.sp, color: BaseStyle.color999999)),
],
),
269.wb,
Text(pd ? "未允许" : "已允许",
style: TextStyle(
fontSize: 24.sp,
color: pd
? const Color(0xFFFF4D4D)
: BaseStyle.color999999)),
SizedBox(
width: 48.w,
height: 48.w,
child: const Icon(
Icons.keyboard_arrow_right,
),
),
],
)),
);
}
}

@ -2,7 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/home/home_page.dart';
import 'package:project_telephony/ui/login/login_page.dart';
import 'package:project_telephony/ui/user/members_page.dart';
import 'package:project_telephony/ui/user/privacy_rights_page.dart';
import 'package:project_telephony/ui/widget/image_scaffold.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
import 'package:project_telephony/utils/headers.dart';
@ -14,8 +16,12 @@ class UserPage extends StatefulWidget {
_UserPageState createState() => _UserPageState();
}
@override
void initState() {}
class _UserPageState extends State<UserPage> {
bool bl = true;
bool vle = false;
@override
Widget build(BuildContext context) {
return CloudScaffold(
@ -28,13 +34,14 @@ class _UserPageState extends State<UserPage> {
extendBody: true,
body: Column(children: [
_getUser(),
36.hb,
72.hb,
_getBanner(),
120.hb,
_getSwitch(Assets.icons.switch1.path, "功能开关", true),
_getSwitch(Assets.icons.privacy.path, "隐私政策", false),
_getSwitch(Assets.icons.permissions.path, "权限说明", false),
// const Spacer(),
182.hb,
PloneBottom(
border: false,
onTap: () {
@ -51,11 +58,16 @@ class _UserPageState extends State<UserPage> {
//
_getUser() {
return Container(
margin: EdgeInsets.only(left: 32.w, right: 32.w, top: 199.w),
return GestureDetector(
onTap: () {
Get.to(() => const LoginPage());
},
child: Container(
margin: EdgeInsets.only(left: 64.w, right: 64.w, top: 216.w),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
bl ? "登录/注册" : "xxxxx",
@ -86,6 +98,7 @@ class _UserPageState extends State<UserPage> {
)
],
),
),
);
}
@ -97,7 +110,7 @@ class _UserPageState extends State<UserPage> {
child: Stack(children: [
Align(
child: SizedBox(
width: 686.w,
width: 622.w,
child: Image.asset(
Assets.images.banner.path,
fit: BoxFit.fill,
@ -105,7 +118,9 @@ class _UserPageState extends State<UserPage> {
)),
Positioned(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 64.w, vertical: 16.w),
padding: EdgeInsets.symmetric(horizontal: 112.w, vertical: 24.w),
// margin: EdgeInsets.symmetric(horizontal: 64.w, vertical: 16.w),
// padding: EdgeInsets.symmetric(),
child: Row(
children: [_getText(), const Spacer(), _getBotton()],
),
@ -118,12 +133,12 @@ class _UserPageState extends State<UserPage> {
_getBotton() {
return GestureDetector(
onTap: () {
Get.to(() => MembersPage());
Get.to(() => const MembersPage());
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
borderRadius: BorderRadius.circular(30.w),
gradient: const LinearGradient(
colors: [Color(0xFFFFF6D8), Color(0xFFFFEAB0)],
begin: Alignment.centerLeft,
@ -139,6 +154,7 @@ class _UserPageState extends State<UserPage> {
//banner
_getText() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_getVip(),
16.hb,
@ -175,8 +191,17 @@ class _UserPageState extends State<UserPage> {
//
_getSwitch(String url, String name, bool pd) {
bool vle = false;
return ListTile(
return GestureDetector(
onTap: () {
pd
? ""
: Get.to(() => PrivacyRightsPage(
name: name,
));
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: ListTile(
// onTap: (() {}),
leading: Image.asset(
url,
@ -195,9 +220,12 @@ class _UserPageState extends State<UserPage> {
? Switch(
value: vle,
onChanged: (value) {
setState(() {
vle = value;
// setState(() {});
});
})
: const Icon(Icons.keyboard_arrow_right));
: const Icon(Icons.keyboard_arrow_right)),
),
);
}
}

@ -0,0 +1,49 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:project_telephony/utils/headers.dart';
class Centertipsalterwidget extends StatefulWidget {
final String title;
final String desText;
const Centertipsalterwidget(
{Key? key, required this.desText, required this.title})
: super(key: key);
@override
_CentertipsalterwidgetState createState() => _CentertipsalterwidgetState();
}
class _CentertipsalterwidgetState extends State<Centertipsalterwidget> {
@override
Widget build(BuildContext context) {
return CupertinoAlertDialog(
title: Text(widget.title),
content: Column(children: [
SizedBox(
height: 10.w,
),
Align(
child: Text(widget.desText),
alignment: const Alignment(0, 0),
)
]),
actions: [
CupertinoDialogAction(
child: const Text(
'取消',
style: TextStyle(color: Color(0xFF999999)),
),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoDialogAction(
child: const Text('确定'),
onPressed: () {
Navigator.pop(context);
},
)
],
);
}
}

@ -82,6 +82,7 @@ class CloudScaffold extends StatelessWidget {
? AnnotatedRegion<SystemUiOverlayStyle>(
value: systemStyle,
child: Scaffold(
resizeToAvoidBottomInset: false,
endDrawer: endDrawer,
backgroundColor: bodyColor,
extendBodyBehindAppBar: extendBody,
@ -110,6 +111,7 @@ class CloudScaffold extends StatelessWidget {
: AnnotatedRegion<SystemUiOverlayStyle>(
value: systemStyle,
child: Scaffold(
resizeToAvoidBottomInset: false,
endDrawer: endDrawer,
backgroundColor: bodyColor,
extendBodyBehindAppBar: extendBody,

@ -11,6 +11,7 @@ class PloneBottom extends StatefulWidget {
final Function() onTap;
final bool blM; //
final bool border; //
final double opacity;
const PloneBottom({
Key? key,
this.text = '返回首页',
@ -19,6 +20,7 @@ class PloneBottom extends StatefulWidget {
this.textColor = kForeGroundColor,
this.blM = true,
this.border = false,
this.opacity = 1,
required this.onTap,
});
@ -34,24 +36,31 @@ class _PloneBottomState extends State<PloneBottom> {
child: Material(
color: Colors.transparent,
child: Container(
height: 84.w,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 15.w),
padding: EdgeInsets.symmetric(vertical: 14.w),
margin: widget.blM
? EdgeInsets.symmetric(horizontal: 32.w)
? EdgeInsets.symmetric(horizontal: 64.w)
: EdgeInsets.only(left: 0.w),
decoration: BoxDecoration(
border: Border.all(
color: const Color(0xFF1890FF),
width: !widget.border ? 1.w : 10.w),
color:
!widget.border ? const Color(0xFF1890FF) : Colors.white,
width: !widget.border ? 1.w : 0.w),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [widget.color1, widget.color2]),
colors: [
widget.color1.withOpacity(widget.opacity),
widget.color2.withOpacity(widget.opacity)
]),
borderRadius: BorderRadius.circular(8.w)),
child: Text(
widget.text,
style: TextStyle(
fontSize: BaseStyle.fontSize28, color: widget.textColor),
fontSize: BaseStyle.fontSize28,
color: widget.textColor,
fontWeight: FontWeight.bold),
),
),
),

@ -36,6 +36,11 @@ class SortWidget extends StatelessWidget {
required this.childAspectRatio,
this.haveButton = false,
required this.pickItem});
// @override
// void initState() {
// super.initState();
// }
@override
Widget build(BuildContext context) {

Loading…
Cancel
Save