64 lines
1.8 KiB
Dart
64 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
|
import '../../../../core/theme/app_spacing.dart';
|
|
import '../../../../core/theme/app_theme.dart';
|
|
import '../../../../core/theme/app_theme_extension.dart';
|
|
import 'avatar_circle.dart';
|
|
|
|
/// 用戶資料卡片 - 頭像 + 用戶名 + 徽章 + chevron
|
|
class ProfileCard extends StatelessWidget {
|
|
final dynamic user;
|
|
const ProfileCard({super.key, required this.user});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: double.infinity,
|
|
padding: const EdgeInsets.all(20),
|
|
decoration: BoxDecoration(
|
|
color: context.appColors.surfaceCard,
|
|
borderRadius: BorderRadius.circular(AppRadius.lg),
|
|
border: Border.all(
|
|
color: context.appColors.ghostBorder,
|
|
),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
// Avatar
|
|
AvatarCircle(
|
|
radius: 24,
|
|
fontSize: 18,
|
|
text: user?.avatarText,
|
|
),
|
|
const SizedBox(width: 12),
|
|
// Name + badge column
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
user?.username ?? '未登錄',
|
|
style: AppTextStyles.headlineLarge(context),
|
|
),
|
|
const SizedBox(height: 4),
|
|
Text(
|
|
'普通用戶',
|
|
style: AppTextStyles.bodyMedium(context).copyWith(
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
// Chevron
|
|
Icon(
|
|
LucideIcons.chevronRight,
|
|
size: 16,
|
|
color: context.colors.onSurfaceVariant,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|