mirror of
https://github.com/nostrlabs-io/zap-stream-flutter.git
synced 2025-06-16 03:58:09 +00:00
@ -13,6 +13,7 @@ import 'package:zap_stream_flutter/widgets/button.dart';
|
|||||||
import 'package:zap_stream_flutter/widgets/chat.dart';
|
import 'package:zap_stream_flutter/widgets/chat.dart';
|
||||||
import 'package:zap_stream_flutter/widgets/pill.dart';
|
import 'package:zap_stream_flutter/widgets/pill.dart';
|
||||||
import 'package:zap_stream_flutter/widgets/profile.dart';
|
import 'package:zap_stream_flutter/widgets/profile.dart';
|
||||||
|
import 'package:zap_stream_flutter/widgets/stream_info.dart';
|
||||||
import 'package:zap_stream_flutter/widgets/zap.dart';
|
import 'package:zap_stream_flutter/widgets/zap.dart';
|
||||||
|
|
||||||
class StreamPage extends StatefulWidget {
|
class StreamPage extends StatefulWidget {
|
||||||
@ -160,6 +161,16 @@ class _StreamPage extends State<StreamPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
constraints: BoxConstraints.expand(),
|
||||||
|
builder: (context) => StreamInfoWidget(stream: stream),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Icon(Icons.info),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
45
lib/widgets/stream_info.dart
Normal file
45
lib/widgets/stream_info.dart
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:zap_stream_flutter/theme.dart';
|
||||||
|
import 'package:zap_stream_flutter/utils.dart';
|
||||||
|
import 'package:zap_stream_flutter/widgets/profile.dart';
|
||||||
|
|
||||||
|
class StreamInfoWidget extends StatelessWidget {
|
||||||
|
final StreamEvent stream;
|
||||||
|
|
||||||
|
const StreamInfoWidget({super.key, required this.stream});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final startedDate =
|
||||||
|
stream.info.starts != null
|
||||||
|
? DateTime.fromMillisecondsSinceEpoch(stream.info.starts! * 1000)
|
||||||
|
: null;
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: Column(
|
||||||
|
spacing: 8,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
ProfileWidget.pubkey(stream.info.host),
|
||||||
|
Text(
|
||||||
|
stream.info.title ?? "",
|
||||||
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
if (startedDate != null)
|
||||||
|
RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
style: TextStyle(color: LAYER_5, fontSize: 14),
|
||||||
|
children: [
|
||||||
|
TextSpan(text: "Started "),
|
||||||
|
TextSpan(text: DateFormat().format(startedDate)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (stream.info.summary?.isNotEmpty ?? false)
|
||||||
|
Text(stream.info.summary!),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user