Files
kryz-go-flutter/lib/show_card.dart
T

65 lines
1.7 KiB
Dart
Executable File

import 'package:flutter/material.dart';
import 'live_info_business_object.dart';
import 'time_formatter.dart';
class ShowCard extends StatelessWidget {
const ShowCard({
super.key,
required this.label,
required this.show,
required this.sourceTimezone,
required this.titleColor,
required this.cardSurface,
required this.cardBorder,
});
final String label;
final LiveInfoShowInfo? show;
final String? sourceTimezone;
final Color titleColor;
final Color cardSurface;
final Color cardBorder;
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: cardSurface,
border: Border.all(color: cardBorder),
),
child: Row(
children: [
Icon(Icons.mic_external_on_rounded, color: titleColor, size: 18),
const SizedBox(width: 8),
Expanded(
child: Text(
'$label: ${show?.name ?? 'No scheduled show'}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(
context,
).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: titleColor,
),
),
),
const SizedBox(width: 8),
Text(
formatStartingTime(
show?.starts,
sourceTimezone: sourceTimezone,
),
style: Theme.of(
context,
).textTheme.labelSmall?.copyWith(color: titleColor),
),
],
),
);
}
}