import 'package:flutter/material.dart'; import 'package:maibu_satabot_v2/features/v2/my/presentation/constants/my_constants.dart'; /// 用户信息卡片组件(100% 还原设计稿) class UserProfileCard extends StatelessWidget { const UserProfileCard({ super.key, required this.name, required this.role, this.onTap, }); final String name; final String role; final VoidCallback? onTap; @override Widget build(BuildContext context) { return Container( width: double.infinity, padding: const EdgeInsets.fromLTRB(20, 70, 20, 50), decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ Color(0xFF165DFF), Color(0xFF0E42CC), ], ), ), child: Row( children: [ // 头像 Container( width: 56, height: 56, decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all( color: Colors.white, width: 2, ), ), child: ClipOval( child: Image.asset( 'assets/images/app_logo.png', fit: BoxFit.cover, errorBuilder: (context, error, stackTrace) { return Container( color: Colors.white, child: Icon( Icons.person, size: 32, color: const Color(0xFF165DFF), ), ); }, ), ), ), const SizedBox(width: 14), // 用户信息 Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( name, style: const TextStyle( fontSize: 18, fontWeight: FontWeight.bold, color: Colors.white, letterSpacing: 0.5, ), ), const SizedBox(height: 6), Text( role, style: TextStyle( fontSize: 13, color: Colors.white.withOpacity(0.85), letterSpacing: 0.3, ), ), ], ), ), // 箭头 Icon( Icons.chevron_right, color: Colors.white.withOpacity(0.9), size: 24, ), ], ), ); } }