and so on
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:maibu_satabot_v2/core/app/app_user_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/core/app/app_user_state.dart';
|
||||
import 'package:maibu_satabot_v2/core/domain/entities/user_entity.dart';
|
||||
import 'package:maibu_satabot_v2/core/theme/AppTheme.dart';
|
||||
|
||||
/// 个人信息详情页
|
||||
class ProfileDetailPage extends StatelessWidget {
|
||||
@@ -11,12 +12,11 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF5F7FA),
|
||||
backgroundColor: context.appColors.pageBackground,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: Color(0xFF1D2129)),
|
||||
icon: Icon(Icons.arrow_back, color: context.appColors.textPrimary),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
title: const Text(
|
||||
@@ -24,7 +24,6 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1D2129),
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
@@ -43,11 +42,11 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
// 头像卡片
|
||||
_buildAvatarCard(user),
|
||||
_buildAvatarCard(context, user),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 信息列表
|
||||
_buildInfoCard(user),
|
||||
_buildInfoCard(context, user),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 操作按钮
|
||||
@@ -60,15 +59,15 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// 头像卡片
|
||||
Widget _buildAvatarCard(UserEntity user) {
|
||||
Widget _buildAvatarCard(BuildContext context, UserEntity user) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 32),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: context.appColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0x0D000000),
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
@@ -95,10 +94,10 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
// 昵称
|
||||
Text(
|
||||
user.nickname,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1D2129),
|
||||
color: context.appColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -107,7 +106,7 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
'@${user.username}',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: const Color(0xFF86909C),
|
||||
color: context.appColors.textTertiary,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -142,14 +141,14 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// 信息卡片
|
||||
Widget _buildInfoCard(UserEntity user) {
|
||||
Widget _buildInfoCard(BuildContext context, UserEntity user) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: context.appColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0x0D000000),
|
||||
color: context.appColors.cardShadow,
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
@@ -158,18 +157,21 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.person_outline,
|
||||
label: '用户ID',
|
||||
value: user.userId,
|
||||
showDivider: true,
|
||||
),
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.account_circle_outlined,
|
||||
label: '用户名',
|
||||
value: user.username,
|
||||
showDivider: true,
|
||||
),
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.badge_outlined,
|
||||
label: '昵称',
|
||||
value: user.nickname,
|
||||
@@ -177,6 +179,7 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
),
|
||||
if (user.email != null)
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.email_outlined,
|
||||
label: '邮箱',
|
||||
value: user.email!,
|
||||
@@ -184,6 +187,7 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
),
|
||||
if (user.phone != null)
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.phone_outlined,
|
||||
label: '手机号',
|
||||
value: user.phone!,
|
||||
@@ -195,7 +199,8 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// 信息项
|
||||
Widget _buildInfoItem({
|
||||
Widget _buildInfoItem(
|
||||
BuildContext context, {
|
||||
required IconData icon,
|
||||
required String label,
|
||||
required String value,
|
||||
@@ -207,13 +212,13 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, size: 22, color: const Color(0xFF86909C)),
|
||||
Icon(icon, size: 22, color: context.appColors.textTertiary),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Color(0xFF86909C),
|
||||
color: context.appColors.textTertiary,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
@@ -221,9 +226,9 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
flex: 2,
|
||||
child: Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Color(0xFF1D2129),
|
||||
color: context.appColors.textPrimary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
textAlign: TextAlign.right,
|
||||
@@ -237,7 +242,7 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
Divider(
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
color: const Color(0xFFF2F3F5),
|
||||
color: context.appColors.divider,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user