mirror of
https://github.com/nostrlabs-io/zap-stream-flutter.git
synced 2025-06-15 11:48:21 +00:00
fix: missing stream hides live page
This commit is contained in:
@ -178,8 +178,8 @@ class _LivePage extends State<LivePage>
|
|||||||
final ev = streamState
|
final ev = streamState
|
||||||
?.sortedBy((e) => e.createdAt)
|
?.sortedBy((e) => e.createdAt)
|
||||||
.firstWhereOrNull((e) => e.getFirstTag("status") == "live");
|
.firstWhereOrNull((e) => e.getFirstTag("status") == "live");
|
||||||
if (ev == null) return SizedBox();
|
|
||||||
final stream = StreamEvent(ev);
|
final stream = ev != null ? StreamEvent(ev) : null;
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
ApiVideoCameraPreview(controller: _controller),
|
ApiVideoCameraPreview(controller: _controller),
|
||||||
@ -207,11 +207,11 @@ class _LivePage extends State<LivePage>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if ((stream.info.participants ?? 0) > 0)
|
if ((stream?.info.participants ?? 0) > 0)
|
||||||
PillWidget(
|
PillWidget(
|
||||||
color: LAYER_2,
|
color: LAYER_2,
|
||||||
child: Text(
|
child: Text(
|
||||||
t.viewers(n: stream.info.participants!),
|
t.viewers(n: stream?.info.participants ?? 0),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@ -348,7 +348,7 @@ class _LivePage extends State<LivePage>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_account != null)
|
if (_account != null && stream != null)
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 80,
|
bottom: 80,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
Reference in New Issue
Block a user