Files
kryz-go-flutter/lib/track_card.dart
T
robot 0257937859
CI / Lint (pull_request) Successful in 19m19s
CI / Test (pull_request) Failing after 19m19s
CI / Build Android (pull_request) Skipped
CI / Build iOS (pull_request) Skipped
style: apply dart formatting fixes across lib/ and test/
11 files had formatting inconsistencies that caused the
--set-exit-if-changed gate to fail. Automated formatting
via dart format now passes cleanly.
2026-08-01 11:06:17 +00:00

77 lines
2.1 KiB
Dart
Executable File

import 'package:flutter/material.dart';
import 'live_info_business_object.dart';
import 'time_formatter.dart';
class TrackCard extends StatelessWidget {
const TrackCard({
super.key,
required this.label,
required this.track,
required this.titleColor,
required this.cardSurface,
required this.cardBorder,
});
final String label;
final LiveInfoTrackInfo? track;
final Color titleColor;
final Color cardSurface;
final Color cardBorder;
@override
Widget build(BuildContext context) {
final String title = track?.displayTitle ?? 'Unavailable';
final String subtitle = (track?.displaySubtitle ?? '').trim();
final String window = formatTimeWindow(track?.starts, track?.ends);
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: cardSurface,
borderRadius: BorderRadius.circular(14),
border: Border.all(color: cardBorder),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
label,
style: Theme.of(context).textTheme.labelMedium?.copyWith(
fontWeight: FontWeight.w700,
color: titleColor,
),
),
const SizedBox(height: 6),
Text(
title,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w700,
color: titleColor,
),
),
const SizedBox(height: 6),
Text(
subtitle.isEmpty ? 'No metadata provided' : subtitle,
maxLines: 6,
overflow: TextOverflow.ellipsis,
style: Theme.of(
context,
).textTheme.bodySmall?.copyWith(color: titleColor),
),
const Spacer(),
Text(
window,
style: Theme.of(context).textTheme.labelMedium?.copyWith(
fontWeight: FontWeight.w600,
color: titleColor,
),
),
],
),
);
}
}