mirror of
https://github.com/nostrlabs-io/zap-stream-flutter.git
synced 2025-06-16 11:58:50 +00:00
@ -88,6 +88,7 @@ class ProfileWidget extends StatelessWidget {
|
||||
final List<Widget>? children;
|
||||
final bool? showName;
|
||||
final double? spacing;
|
||||
final bool? linkToProfile;
|
||||
|
||||
const ProfileWidget({
|
||||
super.key,
|
||||
@ -97,6 +98,7 @@ class ProfileWidget extends StatelessWidget {
|
||||
this.children,
|
||||
this.showName,
|
||||
this.spacing,
|
||||
this.linkToProfile,
|
||||
});
|
||||
|
||||
static Widget pubkey(
|
||||
@ -106,6 +108,7 @@ class ProfileWidget extends StatelessWidget {
|
||||
bool? showName,
|
||||
double? spacing,
|
||||
Key? key,
|
||||
bool? linkToProfile,
|
||||
}) {
|
||||
return ProfileLoaderWidget(pubkey, (ctx, state) {
|
||||
return ProfileWidget(
|
||||
@ -114,6 +117,7 @@ class ProfileWidget extends StatelessWidget {
|
||||
showName: showName,
|
||||
spacing: spacing,
|
||||
key: key,
|
||||
linkToProfile: linkToProfile,
|
||||
children: children,
|
||||
);
|
||||
});
|
||||
@ -125,7 +129,12 @@ class ProfileWidget extends StatelessWidget {
|
||||
spacing: spacing ?? 8,
|
||||
children: [
|
||||
AvatarWidget(profile: profile, size: size),
|
||||
if (showName ?? true) ProfileNameWidget(profile: profile, key: key),
|
||||
if (showName ?? true)
|
||||
ProfileNameWidget(
|
||||
profile: profile,
|
||||
key: key,
|
||||
linkToProfile: linkToProfile,
|
||||
),
|
||||
...(children ?? []),
|
||||
],
|
||||
);
|
||||
|
@ -28,7 +28,7 @@ class StreamInfoWidget extends StatelessWidget {
|
||||
spacing: 8,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ProfileWidget.pubkey(stream.info.host),
|
||||
ProfileWidget.pubkey(stream.info.host, linkToProfile: false),
|
||||
FollowButton(
|
||||
pubkey: stream.info.host,
|
||||
onTap: () {
|
||||
|
@ -23,19 +23,21 @@ class VideoPlayerWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _VideoPlayerWidget extends State<VideoPlayerWidget> {
|
||||
late final VideoPlayerController _controller;
|
||||
late final ChewieController _chewieController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
final controller = VideoPlayerController.networkUrl(
|
||||
_controller = VideoPlayerController.networkUrl(
|
||||
Uri.parse(widget.url),
|
||||
httpHeaders: Map.from({"user-agent": userAgent}),
|
||||
);
|
||||
_chewieController = ChewieController(
|
||||
videoPlayerController: controller,
|
||||
videoPlayerController: _controller,
|
||||
autoPlay: widget.autoPlay ?? true,
|
||||
aspectRatio: widget.aspectRatio,
|
||||
autoInitialize: true,
|
||||
placeholder:
|
||||
(widget.placeholder?.isNotEmpty ?? false)
|
||||
@ -46,8 +48,9 @@ class _VideoPlayerWidget extends State<VideoPlayerWidget> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_controller.dispose();
|
||||
_chewieController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
|
Reference in New Issue
Block a user