diff --git a/lib/utils.dart b/lib/utils.dart index 1f205ac..1758384 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -365,4 +365,4 @@ String encodeBech32TLV(String hrp, List tlvs) { } catch (e) { throw FormatException('Failed to encode Bech32 or TLV: $e'); } -} +} \ No newline at end of file diff --git a/lib/widgets/stream_grid.dart b/lib/widgets/stream_grid.dart index b576027..2651c21 100644 --- a/lib/widgets/stream_grid.dart +++ b/lib/widgets/stream_grid.dart @@ -24,6 +24,7 @@ class StreamGrid extends StatelessWidget { final streams = events .map((e) => StreamEvent(e)) + .where((e) => e.info.stream?.contains(".m3u8") ?? false) .sortedBy((a) => a.info.starts ?? a.event.createdAt) .reversed; final live = streams.where((s) => s.info.status == StreamStatus.live); @@ -32,11 +33,12 @@ class StreamGrid extends StatelessWidget { return Column( spacing: 16, children: [ - if (showLive && live.isNotEmpty) _streamGroup(context, "Live", live), + if (showLive && live.isNotEmpty) + _streamGroup(context, "Live", live.toList()), if (showPlanned && planned.isNotEmpty) - _streamGroup(context, "Planned", planned), + _streamGroup(context, "Planned", planned.toList()), if (showEnded && ended.isNotEmpty) - _streamGroup(context, "Ended", ended), + _streamGroup(context, "Ended", ended.toList()), ], ); } @@ -64,22 +66,18 @@ class StreamGrid extends StatelessWidget { Widget _streamGroup( BuildContext context, String title, - Iterable events, + List events, ) { - final eventList = events.toList(); - - // profide fixed item size for performance - final q = MediaQuery.of(context); return Column( spacing: 16, children: [ _streamTitle(title), ListView.builder( - itemCount: eventList.length, + itemCount: events.length, primary: false, shrinkWrap: true, itemBuilder: (ctx, idx) { - final stream = eventList[idx]; + final stream = events[idx]; return Padding( padding: EdgeInsets.symmetric(vertical: 8), child: StreamTileWidget(stream),