2026-04-05 22:38:56 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
2026-04-05 23:37:27 +08:00
|
|
|
import '../../../../core/theme/app_theme.dart';
|
2026-04-05 22:38:56 +08:00
|
|
|
import 'avatar_circle.dart';
|
|
|
|
|
|
2026-04-08 01:47:51 +08:00
|
|
|
/// 用户资料卡片
|
2026-04-05 22:38:56 +08:00
|
|
|
class ProfileCard extends StatelessWidget {
|
|
|
|
|
final dynamic user;
|
|
|
|
|
const ProfileCard({super.key, required this.user});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2026-04-08 01:47:51 +08:00
|
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
|
|
2026-04-05 22:38:56 +08:00
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
2026-04-08 01:47:51 +08:00
|
|
|
padding: const EdgeInsets.all(16),
|
2026-04-05 22:38:56 +08:00
|
|
|
decoration: BoxDecoration(
|
2026-04-08 01:47:51 +08:00
|
|
|
color: colorScheme.surface,
|
|
|
|
|
borderRadius: BorderRadius.circular(14),
|
2026-04-05 22:38:56 +08:00
|
|
|
border: Border.all(
|
2026-04-08 01:47:51 +08:00
|
|
|
color: colorScheme.outlineVariant.withValues(alpha: 0.5),
|
2026-04-05 22:38:56 +08:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
AvatarCircle(
|
2026-04-08 01:47:51 +08:00
|
|
|
radius: 22,
|
|
|
|
|
fontSize: 16,
|
2026-04-05 22:38:56 +08:00
|
|
|
text: user?.avatarText,
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 12),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
2026-04-07 01:05:05 +08:00
|
|
|
user?.username ?? '未登錄',
|
2026-04-08 01:47:51 +08:00
|
|
|
style: AppTextStyles.bodyLarge(context).copyWith(
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
2026-04-05 22:38:56 +08:00
|
|
|
),
|
2026-04-08 01:47:51 +08:00
|
|
|
const SizedBox(height: 2),
|
2026-04-05 22:38:56 +08:00
|
|
|
Text(
|
2026-04-07 01:05:05 +08:00
|
|
|
'普通用戶',
|
2026-04-08 01:47:51 +08:00
|
|
|
style: AppTextStyles.bodySmall(context).copyWith(
|
|
|
|
|
color: colorScheme.onSurfaceVariant,
|
2026-04-05 22:38:56 +08:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
LucideIcons.chevronRight,
|
|
|
|
|
size: 16,
|
2026-04-08 01:47:51 +08:00
|
|
|
color: colorScheme.onSurfaceVariant,
|
2026-04-05 22:38:56 +08:00
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|