style(frontend): polish student workspace
This commit is contained in:
@@ -27,96 +27,122 @@ class EnsupTopBar extends StatelessWidget {
|
||||
final onBack = this.onBack;
|
||||
|
||||
return Container(
|
||||
height: 56,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
height: 60,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 18),
|
||||
color: EnsupColors.blue3,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final compact = constraints.maxWidth < 620;
|
||||
final showCampus = constraints.maxWidth >= 520;
|
||||
final showName = constraints.maxWidth >= 760;
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
if (onBack != null) ...[
|
||||
_BackButton(onTap: onBack),
|
||||
const SizedBox(width: 8),
|
||||
_BackButton(onTap: onBack, compact: compact),
|
||||
SizedBox(width: compact ? 5 : 8),
|
||||
],
|
||||
const Icon(Icons.badge_outlined, color: Colors.white, size: 18),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
brandText,
|
||||
style: GoogleFonts.darkerGrotesque(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 22,
|
||||
letterSpacing: 0.3,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.15),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
border: Border.all(color: Colors.white.withValues(alpha: 0.2)),
|
||||
),
|
||||
const SizedBox(width: 9),
|
||||
Expanded(
|
||||
child: Text(
|
||||
campusTag,
|
||||
style: GoogleFonts.titilliumWeb(
|
||||
brandText,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: GoogleFonts.darkerGrotesque(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: compact ? 18 : 21,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (name != null && initials != null) ...[
|
||||
const SizedBox(width: 12),
|
||||
_Avatar(initials: initials),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
name,
|
||||
style: GoogleFonts.titilliumWeb(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
const SizedBox(width: 10),
|
||||
if (showCampus)
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 11,
|
||||
vertical: 5,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.14),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
border: Border.all(
|
||||
color: Colors.white.withValues(alpha: 0.2),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
campusTag,
|
||||
style: GoogleFonts.titilliumWeb(
|
||||
color: Colors.white,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (name != null && initials != null) ...[
|
||||
const SizedBox(width: 10),
|
||||
_Avatar(initials: initials),
|
||||
if (showName) ...[
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
name,
|
||||
style: GoogleFonts.titilliumWeb(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _BackButton extends StatelessWidget {
|
||||
const _BackButton({required this.onTap});
|
||||
const _BackButton({required this.onTap, required this.compact});
|
||||
|
||||
final VoidCallback onTap;
|
||||
final bool compact;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.arrow_back, size: 16, color: Colors.white.withValues(alpha: 0.85)),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
"Retour",
|
||||
style: GoogleFonts.titilliumWeb(
|
||||
color: Colors.white.withValues(alpha: 0.85),
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
return Tooltip(
|
||||
message: "Retour",
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
child: Container(
|
||||
height: 34,
|
||||
padding: EdgeInsets.symmetric(horizontal: compact ? 8 : 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.08),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.arrow_back_rounded,
|
||||
size: 17,
|
||||
color: Colors.white.withValues(alpha: 0.9),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (!compact) ...[
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
"Retour",
|
||||
style: GoogleFonts.titilliumWeb(
|
||||
color: Colors.white.withValues(alpha: 0.9),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -135,8 +161,11 @@ class _Avatar extends StatelessWidget {
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
gradient: const LinearGradient(colors: [EnsupColors.teal, EnsupColors.cyan]),
|
||||
border: Border.all(color: Colors.white.withValues(alpha: 0.3), width: 2),
|
||||
color: EnsupColors.purple,
|
||||
border: Border.all(
|
||||
color: Colors.white.withValues(alpha: 0.3),
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
|
||||
Reference in New Issue
Block a user