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.
 
 
 
 
 

196 lines
7.4 KiB

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
import '../../controller/mine/auth_controller.dart';
class RealNamePage extends StatelessWidget {
RealNamePage({super.key});
final AuthController controller = Get.put(AuthController());
// 是否同意协议
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xffFFFFFF),
appBar: AppBar(
title: Text('实名认证', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, size: 24, color: Colors.grey,),
onPressed: () {
Get.back();
},
),
),
body: Column(
children: [
Container(
height: 48,
decoration: BoxDecoration(color: Color(0xffE7E7E7)),
padding: const EdgeInsets.only(left: 16),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center, // 垂直居中
children: [
Text(
'*请填写本人实名信息',
style: TextStyle(
fontSize: 14,
color: Colors.black87,
),
),
],
),
),
Container(
height: 56, // 固定高度确保垂直居中
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey[400]!,
width: 0.5,
),
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center, // 垂直居中
children: [
// 左侧标签 - 固定宽度 + 垂直居中
Container(
width: 100,
alignment: Alignment.centerLeft,
padding: const EdgeInsets.only(left: 16),
child: Text(
'姓名:',
style: TextStyle(
fontSize: 15,
color: Colors.black87,
),
),
),
SizedBox(width: 12),
// 输入框区域 - 使用Expanded填充剩余空间
Expanded(
child: Container(
alignment: Alignment.centerLeft, // 输入框内容垂直居中
child: TextField(
decoration: InputDecoration(
hintText: '请输入姓名',
hintStyle: TextStyle(color: Colors.grey[500]),
border: InputBorder.none, // 隐藏默认边框
contentPadding: EdgeInsets.zero, // 去除默认padding
isDense: true, // 紧凑模式
),
style: TextStyle(
fontSize: 15,
height: 1.2, // 控制文字垂直位置
),
onChanged: (value) {
controller.name.value = value;
},
),
),
),
],
),
),
// SizedBox(height: 30),
Container(
height: 56, // 固定高度确保垂直居中
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey[400]!,
width: 0.5,
),
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center, // 垂直居中
children: [
// 左侧标签 - 固定宽度 + 垂直居中
Container(
width: 100,
alignment: Alignment.centerLeft,
padding: const EdgeInsets.only(left: 16),
child: Text(
'身份证号:',
style: TextStyle(
fontSize: 15,
color: Colors.black87,
),
),
),
SizedBox(width: 12),
// 输入框区域 - 使用Expanded填充剩余空间
Expanded(
child: Container(
alignment: Alignment.centerLeft, // 输入框内容垂直居中
child: TextField(
decoration: InputDecoration(
hintText: '请输入身份证号',
hintStyle: TextStyle(color: Colors.grey[500]),
border: InputBorder.none, // 隐藏默认边框
contentPadding: EdgeInsets.zero, // 去除默认padding
isDense: true, // 紧凑模式
),
style: TextStyle(
fontSize: 15,
height: 1.2, // 控制文字垂直位置
),
onChanged: (value) {
controller.idcard.value = value;
},
),
),
),
],
),
),
SizedBox(height: 24),
// 协议同意复选框
Row(
crossAxisAlignment: CrossAxisAlignment.start, // 垂直居中
children: [
SizedBox(width: 8),
Obx(() => Checkbox(
value: controller.agree.value,
onChanged: (value) {
controller.agree.value = value ?? false;
},
activeColor: Color(0xff7562F9),
side: const BorderSide(color: Colors.grey),
shape: const CircleBorder(),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
)),
ConstrainedBox(
constraints: BoxConstraints(maxWidth: 300), // 限制最大宽度
child: Text(
'依据法律法规的要求,我们将收集您的真实姓名,身份证号用于实名认证,认证信息将用于直播连麦、收益提现、依据证件信息更正性别等,与账号唯一绑定,我们会使用加密方式对您的认证信息进行严格保密。',
style: TextStyle( fontSize: 13, color: Colors.grey ),
),
)
],
),
SizedBox(height: 48),
TDButton(
text: '立即认证',
width: MediaQuery.of(context).size.width - 40,
size: TDButtonSize.large,
type: TDButtonType.fill,
shape: TDButtonShape.round,
theme: TDButtonTheme.primary,
onTap: (){
controller.startAuthing();
},
),
],
),
);
}
}