分区相关
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/localization/app_localizations.dart';
|
||||
import 'package:maibu_satabot_v2/core/theme/AppTheme.dart';
|
||||
import 'package:maibu_satabot_v2/core/utils/image_url_util.dart';
|
||||
|
||||
@@ -20,9 +21,9 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
icon: Icon(Icons.arrow_back, color: context.appColors.textPrimary),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
title: const Text(
|
||||
'个人信息',
|
||||
style: TextStyle(
|
||||
title: Text(
|
||||
AppLocalizations.of(context).translate('my_v2.profile_title'),
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -34,8 +35,10 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
final user = state.user;
|
||||
|
||||
if (user == null) {
|
||||
return const Center(
|
||||
child: Text('未登录'),
|
||||
return Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).translate('my_v2.not_logged_in'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -145,6 +148,7 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
|
||||
/// 信息卡片
|
||||
Widget _buildInfoCard(BuildContext context, UserEntity user) {
|
||||
final l10n = AppLocalizations.of(context);
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: context.appColors.cardBackground,
|
||||
@@ -162,21 +166,21 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.person_outline,
|
||||
label: '用户ID',
|
||||
label: l10n.translate('my_v2.user_id'),
|
||||
value: user.userId,
|
||||
showDivider: true,
|
||||
),
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.account_circle_outlined,
|
||||
label: '用户名',
|
||||
label: l10n.translate('my_v2.username'),
|
||||
value: user.username,
|
||||
showDivider: true,
|
||||
),
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.badge_outlined,
|
||||
label: '昵称',
|
||||
label: l10n.translate('my_v2.nickname'),
|
||||
value: user.nickname,
|
||||
showDivider: user.email != null || user.phone != null,
|
||||
),
|
||||
@@ -184,7 +188,7 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.email_outlined,
|
||||
label: '邮箱',
|
||||
label: l10n.translate('my_v2.email'),
|
||||
value: user.email!,
|
||||
showDivider: user.phone != null,
|
||||
),
|
||||
@@ -192,7 +196,7 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
_buildInfoItem(
|
||||
context,
|
||||
icon: Icons.phone_outlined,
|
||||
label: '手机号',
|
||||
label: l10n.translate('my_v2.phone'),
|
||||
value: user.phone!,
|
||||
showDivider: false,
|
||||
),
|
||||
@@ -253,6 +257,7 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
|
||||
/// 操作按钮
|
||||
Widget _buildActionButtons(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
// 编辑资料按钮(预留)
|
||||
@@ -263,13 +268,15 @@ class ProfileDetailPage extends StatelessWidget {
|
||||
onPressed: () {
|
||||
// TODO: 跳转到编辑资料页面
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('编辑功能开发中...')),
|
||||
SnackBar(
|
||||
content: Text(l10n.translate('my_v2.edit_in_progress')),
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.edit, size: 20),
|
||||
label: const Text(
|
||||
'编辑资料',
|
||||
style: TextStyle(fontSize: 16),
|
||||
label: Text(
|
||||
l10n.translate('my_v2.edit_profile_action'),
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF165DFF),
|
||||
|
||||
Reference in New Issue
Block a user