138 lines
4.5 KiB
Dart
138 lines
4.5 KiB
Dart
import "package:flutter/material.dart";
|
|
import "package:google_fonts/google_fonts.dart";
|
|
import "../theme/ensup_colors.dart";
|
|
|
|
/// Carte de profil de l'étudiant identifié (accueil).
|
|
class ProfileCard extends StatelessWidget {
|
|
const ProfileCard({
|
|
super.key,
|
|
required this.name,
|
|
required this.subtitle,
|
|
required this.initials,
|
|
});
|
|
|
|
final String name;
|
|
final String subtitle;
|
|
final String initials;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 16),
|
|
decoration: BoxDecoration(
|
|
color: EnsupColors.cyan.withValues(alpha: 0.055),
|
|
borderRadius: BorderRadius.circular(12),
|
|
border: Border.all(
|
|
color: EnsupColors.cyan.withValues(alpha: 0.15),
|
|
width: 1.5,
|
|
),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: EnsupColors.blue3.withValues(alpha: 0.045),
|
|
blurRadius: 12,
|
|
offset: const Offset(0, 4),
|
|
),
|
|
],
|
|
),
|
|
child: LayoutBuilder(
|
|
builder: (context, constraints) {
|
|
final showStatus = constraints.maxWidth >= 430;
|
|
return Row(
|
|
children: [
|
|
Container(
|
|
width: 50,
|
|
height: 50,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: EnsupColors.teal,
|
|
border: Border.all(color: Colors.white, width: 3),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: EnsupColors.teal.withValues(alpha: 0.22),
|
|
blurRadius: 10,
|
|
offset: const Offset(0, 3),
|
|
),
|
|
],
|
|
),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
initials,
|
|
style: GoogleFonts.darkerGrotesque(
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.w900,
|
|
fontSize: 18,
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(width: 14),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
name,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: GoogleFonts.darkerGrotesque(
|
|
fontWeight: FontWeight.w800,
|
|
fontSize: 20,
|
|
height: 1,
|
|
color: EnsupColors.text,
|
|
),
|
|
),
|
|
const SizedBox(height: 4),
|
|
Text(
|
|
subtitle,
|
|
maxLines: 2,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: GoogleFonts.titilliumWeb(
|
|
fontSize: 12,
|
|
color: EnsupColors.muted,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
if (showStatus) ...[
|
|
const SizedBox(width: 12),
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 11,
|
|
vertical: 6,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: EnsupColors.green.withValues(alpha: 0.1),
|
|
borderRadius: BorderRadius.circular(999),
|
|
border: Border.all(
|
|
color: EnsupColors.green.withValues(alpha: 0.18),
|
|
),
|
|
),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
const Icon(
|
|
Icons.check_circle,
|
|
size: 13,
|
|
color: EnsupColors.green,
|
|
),
|
|
const SizedBox(width: 5),
|
|
Text(
|
|
"Identifié",
|
|
style: GoogleFonts.titilliumWeb(
|
|
fontSize: 11,
|
|
fontWeight: FontWeight.w700,
|
|
color: EnsupColors.green,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
],
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|