修改选择器样式
This commit is contained in:
232
lib/pages/mh_page/edit_userinfo_page.dart
Normal file
232
lib/pages/mh_page/edit_userinfo_page.dart
Normal file
@@ -0,0 +1,232 @@
|
||||
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
|
||||
import '../../controller/mh_controller/muser_info_controller.dart';
|
||||
|
||||
class EditUserInfoPage extends GetView<MUserInfoController> {
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
// EditUserInfoPage() {
|
||||
// UserInfoController controller = Get.find();
|
||||
// controller.model.user!.tmpHead = controller.model.user!.head;
|
||||
// }
|
||||
MUserInfoController controller = Get.find();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// UserInfoController controller = Get.find();
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
key: scaffoldKey,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 70.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'编辑资料',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 20.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
Positioned(
|
||||
right: 30.rpx,
|
||||
child: CustomCard(
|
||||
borderRadius: 16.rpx,
|
||||
gradientDirection: GradientDirection.vertical,
|
||||
onTap: () {},
|
||||
colors: const [
|
||||
Color(0xFFFCFCFC),
|
||||
Color(0xFFF8FAF9),
|
||||
Color(0XFFECF6F3),
|
||||
Color(0XFFD9F0E9),
|
||||
Color(0xFFCEECE3)
|
||||
],
|
||||
child: Container(
|
||||
width: 120.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(5),
|
||||
// color: stringToColor("#182B7C"),
|
||||
// ),
|
||||
child: Text(
|
||||
"保存",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: stringToColor("#9EA4B7"),
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
centerTitle: false,
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 108.rpx),
|
||||
child: Container(
|
||||
width: 160.rpx,
|
||||
height: 160.rpx,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Image.asset(
|
||||
"assets/images/people_avatar.png",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 44.rpx),
|
||||
child: Text(
|
||||
'点击更换头像',
|
||||
style:
|
||||
TextStyle(color: Color(0XFF85F5FF), fontSize: 26.rpx),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.fromLTRB(60.rpx, 122.rpx, 60.rpx, 0.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 88.rpx,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
color: Color(0xFFD3D3D3), width: 2.rpx), // 上边线
|
||||
bottom: BorderSide(
|
||||
color: Color(0xFFD3D3D3), width: 2.rpx), // 下边线
|
||||
),
|
||||
),
|
||||
alignment: Alignment(0, 0),
|
||||
child: TextField(
|
||||
obscureText: false,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.done,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30.rpx, color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.transparent,
|
||||
filled: true,
|
||||
hintText: "请输入昵称",
|
||||
hintStyle: TextStyle(color: Colors.white),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.all(0)),
|
||||
onChanged: (value) {
|
||||
controller.model.user?.nickName = value;
|
||||
controller.updateAll();
|
||||
},
|
||||
controller: controller.onReDraw(
|
||||
TextEditingController(
|
||||
text: controller.model.user?.nickName ?? ""),
|
||||
(textEditingController) {
|
||||
textEditingController.text =
|
||||
controller.model.user?.nickName ?? "";
|
||||
}),
|
||||
),
|
||||
// Text(
|
||||
// '玛利亚',
|
||||
// style: TextStyle(
|
||||
// color: Color(0XFFFFFFFF), fontSize: 26.rpx),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
// Widget getImageWidget(BuildContext context) {
|
||||
// try {
|
||||
// UserInfoController controller = Get.find();
|
||||
|
||||
// var head = controller.model.user!.tmpHead;
|
||||
// return InkWell(
|
||||
// onTap: () {
|
||||
// controller.uploadImg();
|
||||
// },
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Container(
|
||||
// width: 50,
|
||||
// height: 50,
|
||||
// decoration: BoxDecoration(
|
||||
// color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
// ),
|
||||
// child: Container(
|
||||
// width: 120,
|
||||
// height: 120,
|
||||
// clipBehavior: Clip.antiAlias,
|
||||
// decoration: BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
// ),
|
||||
// child: head == null || head.isEmpty
|
||||
// ? Image.asset(
|
||||
// 'assets/images/avatar.png',
|
||||
// fit: BoxFit.cover,
|
||||
// )
|
||||
// : Image.network(
|
||||
// "${getStorageResourceUrl(head)}",
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(width: 10),
|
||||
// Icon(
|
||||
// Icons.arrow_forward_ios,
|
||||
// color: Color(0xFF373737),
|
||||
// size: 12,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// } catch (e) {
|
||||
// print(e);
|
||||
// }
|
||||
// return Container();
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user