small fixes with new targets not implemented yet.

This commit is contained in:
2025-12-21 15:35:34 +01:00
parent 3d033817a5
commit 99b26893e7
25 changed files with 191 additions and 30 deletions
+179 -29
View File
@@ -670,6 +670,22 @@ class _CalendarScreenState extends State<CalendarScreen> {
),
const SizedBox(height: 8),
_buildSampleEventCard(accentColor, EventType.sestanek),
const SizedBox(height: 32),
// Other dates section
Text(
'Other Dates (without emphasis)',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.grey[600],
),
),
const SizedBox(height: 8),
_buildOtherDateEventCard(accentColor, EventType.regular, 'Tomorrow'),
const SizedBox(height: 12),
_buildOtherDateEventCard(accentColor, EventType.competition, 'Next Week'),
const SizedBox(height: 12),
_buildOtherDateEventCard(accentColor, EventType.sestanek, 'In 5 days'),
const SizedBox(height: 24),
],
),
@@ -942,11 +958,11 @@ class _CalendarScreenState extends State<CalendarScreen> {
color: backgroundColor,
borderRadius: BorderRadius.circular(12),
boxShadow: [
// Card glow effect for today's events
// Strong glow effect for today's events (sample is always today)
BoxShadow(
color: cardAccentColor.withValues(alpha: 0.3),
blurRadius: 16,
offset: const Offset(0, 4),
color: cardAccentColor.withValues(alpha: 0.4),
blurRadius: 20,
offset: const Offset(0, 6),
),
// Subtle inner shadow
BoxShadow(
@@ -964,7 +980,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: cardAccentColor.withValues(alpha: 0.2),
color: cardAccentColor,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(12),
topRight: Radius.circular(12),
@@ -972,22 +988,22 @@ class _CalendarScreenState extends State<CalendarScreen> {
),
child: Row(
children: [
// Small colored indicator
// Small white indicator line
Container(
width: 4,
height: 16,
decoration: BoxDecoration(
color: cardAccentColor,
color: Colors.white,
borderRadius: BorderRadius.circular(2),
),
),
const SizedBox(width: 8),
Text(
_t('Today'),
style: TextStyle(
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: cardAccentColor,
color: Colors.white,
),
),
const Spacer(),
@@ -1005,7 +1021,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
const SizedBox(width: 4),
Text(
eventType == EventType.competition
? _t('TEKMOVANJE')
? _t('TEKMOWANIE')
: eventType == EventType.sestanek
? _t('SESTANEK')
: _t('DEŽURSTVO'),
@@ -1052,13 +1068,6 @@ class _CalendarScreenState extends State<CalendarScreen> {
value: time,
accentColor: cardAccentColor,
),
const SizedBox(height: 6),
// Location
_buildDetailRowInline(
icon: Icons.location_on,
value: _t('Strelišče Ljubljana'),
accentColor: cardAccentColor,
),
],
),
),
@@ -1068,6 +1077,147 @@ class _CalendarScreenState extends State<CalendarScreen> {
);
}
Widget _buildOtherDateEventCard(Color accentColor, EventType eventType, String dateLabel) {
// Color coding for each event type
Color cardAccentColor;
Color backgroundColor = Colors.grey[300]!;
IconData eventIcon;
String title;
String time;
switch (eventType) {
case EventType.competition:
cardAccentColor = Colors.orange;
eventIcon = Icons.emoji_events;
title = _t('League / Competition');
time = '09:00 - 18:00';
break;
case EventType.sestanek:
cardAccentColor = Colors.red;
eventIcon = Icons.groups;
title = _t('Team Meeting');
time = '18:00 - 19:00';
break;
case EventType.regular:
cardAccentColor = Colors.blue;
eventIcon = Icons.event;
title = _t('Duty Shift');
time = '14:00 - 16:00';
break;
}
return RepaintBoundary(
child: Container(
margin: const EdgeInsets.symmetric(vertical: 6, horizontal: 16),
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Date header
Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: cardAccentColor.withValues(alpha: 0.7),
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(12),
topRight: Radius.circular(12),
),
),
child: Row(
children: [
// Small white indicator line
Container(
width: 4,
height: 16,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2),
),
),
const SizedBox(width: 8),
Text(
dateLabel,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
const Spacer(),
// Event type badge
Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: cardAccentColor,
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(eventIcon, size: 12, color: Colors.white),
const SizedBox(width: 4),
Text(
eventType == EventType.competition
? _t('TEKMOVANJE')
: eventType == EventType.sestanek
? _t('SESTANEK')
: _t('DEŽURSTVO'),
style: const TextStyle(
fontSize: 10,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 0.8,
),
),
],
),
),
],
),
),
// Main content
Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Title with icon
Row(
children: [
Icon(eventIcon, size: 20, color: cardAccentColor),
const SizedBox(width: 8),
Expanded(
child: Text(
title,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
),
],
),
const SizedBox(height: 8),
// Time range
_buildDetailRowInline(
icon: Icons.access_time,
value: time,
accentColor: cardAccentColor,
),
],
),
),
],
),
),
);
}
Widget _buildEventCard(CalendarEvent event, Color accentColor) {
final startTime = event.startTime;
final isAllDay = event.isAllDay;
@@ -1131,19 +1281,19 @@ class _CalendarScreenState extends State<CalendarScreen> {
color: backgroundColor,
borderRadius: BorderRadius.circular(12),
boxShadow: [
// Card glow effect (stronger for today's events)
if (isToday)
// Strong glow effect only for today's events
if (isToday) ...[
BoxShadow(
color: cardAccentColor.withValues(alpha: 0.3),
blurRadius: 16,
offset: const Offset(0, 4),
color: cardAccentColor.withValues(alpha: 0.4),
blurRadius: 20,
offset: const Offset(0, 6),
),
// Subtle inner shadow
BoxShadow(
color: Colors.grey.withValues(alpha: 0.1),
blurRadius: 4,
offset: const Offset(0, 2),
),
BoxShadow(
color: Colors.grey.withValues(alpha: 0.1),
blurRadius: 4,
offset: const Offset(0, 2),
),
],
],
),
child: Column(
@@ -1154,7 +1304,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: cardAccentColor,
color: isToday ? cardAccentColor : cardAccentColor.withValues(alpha: 0.7),
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(12),
topRight: Radius.circular(12),