closestTo static method
Implementation
static LiveBroadcastItem closestTo(List<LiveBroadcastItem> items,
{DateTime? dateTime}) {
final check = dateTime ?? DateTime.now().toUtc();
return items.reduce((a, b) {
print(
'a: ${a.defaultStartTime().difference(check).abs().inSeconds}, b: ${b.defaultStartTime().difference(check).abs().inSeconds}');
return a.defaultStartTime().difference(check).abs() <
b.defaultStartTime().difference(check).abs()
? a
: b;
});
}