mirror of
https://github.com/lichess-org/mobile.git
synced 2026-05-26 13:50:52 +00:00
add broadcast group live indicators (#2365)
This commit is contained in:
@@ -110,7 +110,12 @@ typedef BroadcastTournamentInformation = ({
|
||||
|
||||
typedef BroadcastTournamentDates = ({DateTime startsAt, DateTime? endsAt});
|
||||
|
||||
typedef BroadcastTournamentGroup = ({BroadcastTournamentId id, String name});
|
||||
typedef BroadcastTournamentGroup = ({
|
||||
BroadcastTournamentId id,
|
||||
String name,
|
||||
bool active,
|
||||
bool live,
|
||||
});
|
||||
|
||||
@freezed
|
||||
sealed class BroadcastRound with _$BroadcastRound {
|
||||
|
||||
@@ -148,8 +148,10 @@ BroadcastTournament _makeTournamentFromJson(Map<String, dynamic> json) {
|
||||
BroadcastTournamentGroup _tournamentGroupFromPick(RequiredPick pick) {
|
||||
final id = pick('id').asBroadcastTournamentIdOrThrow();
|
||||
final name = pick('name').asStringOrThrow();
|
||||
final active = pick('active').asBoolOrFalse();
|
||||
final live = pick('live').asBoolOrFalse();
|
||||
|
||||
return (id: id, name: name);
|
||||
return (id: id, name: name, active: active, live: live);
|
||||
}
|
||||
|
||||
BroadcastRound _roundFromPick(RequiredPick pick) {
|
||||
|
||||
@@ -492,6 +492,11 @@ class _TournamentSelectorState extends ConsumerState<_TournamentSelectorMenu> {
|
||||
key: tournament.id == widget.tournament.data.id ? currentTournamentKey : null,
|
||||
selected: tournament.id == widget.tournament.data.id,
|
||||
title: Text(tournament.name),
|
||||
trailing: !tournament.active
|
||||
? Icon(Icons.check, color: context.lichessColors.good)
|
||||
: tournament.live
|
||||
? Icon(Icons.circle, color: context.lichessColors.error)
|
||||
: null,
|
||||
onTap: () {
|
||||
widget.setTournamentId(tournament.id);
|
||||
Navigator.of(context).pop();
|
||||
|
||||
Reference in New Issue
Block a user