Skip to content

Commit

Permalink
Don't display round for past broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Dec 16, 2024
1 parent 8130787 commit dfadce4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion lib/src/utils/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ImageColorWorker {
final (int id, Uint32List image) = message as (int, Uint32List);
try {
// final stopwatch0 = Stopwatch()..start();
final QuantizerResult quantizerResult = await QuantizerCelebi().quantize(image, 32);
final quantizerResult = await QuantizerCelebi().quantize(image, 32);
final Map<int, int> colorToCount = quantizerResult.colorToCount.map(
(int key, int value) => MapEntry<int, int>(_getArgbFromAbgr(key), value),
);
Expand Down
72 changes: 37 additions & 35 deletions lib/src/view/broadcast/broadcast_list_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,13 @@ class _BroadcastCartState extends State<BroadcastCard> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.broadcast.round.startsAt != null)
Padding(
padding: kBroadcastGridItemContentPadding,
child: Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Padding(
padding: kBroadcastGridItemContentPadding,
child: Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
if (!widget.broadcast.isFinished) ...[
Text(
widget.broadcast.round.name,
style: TextStyle(
Expand All @@ -462,6 +462,8 @@ class _BroadcastCartState extends State<BroadcastCard> {
maxLines: 1,
),
const SizedBox(width: 5.0),
],
if (widget.broadcast.round.startsAt != null)
Expanded(
child: Text(
relativeDate(widget.broadcast.round.startsAt!),
Expand All @@ -470,13 +472,28 @@ class _BroadcastCartState extends State<BroadcastCard> {
maxLines: 1,
),
),
if (widget.broadcast.isLive) ...[
Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.circle,
size: 16,
if (widget.broadcast.isLive) ...[
Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.circle,
size: 16,
color: liveColor,
shadows: const [
Shadow(
color: Colors.black54,
offset: Offset(0, 1),
blurRadius: 2,
),
],
),
const SizedBox(width: 4.0),
Text(
'LIVE',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: liveColor,
shadows: const [
Shadow(
Expand All @@ -486,29 +503,14 @@ class _BroadcastCartState extends State<BroadcastCard> {
),
],
),
const SizedBox(width: 4.0),
Text(
'LIVE',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: liveColor,
shadows: const [
Shadow(
color: Colors.black54,
offset: Offset(0, 1),
blurRadius: 2,
),
],
),
overflow: TextOverflow.ellipsis,
),
],
),
],
overflow: TextOverflow.ellipsis,
),
],
),
],
),
],
),
),
Padding(
padding: kBroadcastGridItemContentPadding.add(
const EdgeInsets.symmetric(vertical: 3.0),
Expand Down

0 comments on commit dfadce4

Please sign in to comment.