fixes #370: remove all controls on full screen media if message is of type ephemeral (#373)

This commit is contained in:
Salvatore Giordano
2021-04-01 12:01:50 +02:00
committed by GitHub
parent b32bf7a8f1
commit 425fd5c4d8
3 changed files with 54 additions and 45 deletions
@@ -185,6 +185,7 @@ class _FullScreenMediaState extends State<FullScreenMedia>
widget.message, StreamChannel.of(context).channel); widget.message, StreamChannel.of(context).channel);
}, },
), ),
if (widget.message.type != 'ephemeral')
ImageFooter( ImageFooter(
currentPage: _currentPage, currentPage: _currentPage,
totalPages: widget.mediaAttachments.length, totalPages: widget.mediaAttachments.length,
@@ -78,6 +78,7 @@ class _ImageFooterState extends State<ImageFooter> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final showShareButton = !kIsWeb;
return SizedBox.fromSize( return SizedBox.fromSize(
size: Size( size: Size(
MediaQuery.of(context).size.width, MediaQuery.of(context).size.width,
@@ -91,8 +92,10 @@ class _ImageFooterState extends State<ImageFooter> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
kIsWeb !showShareButton
? SizedBox() ? Container(
width: 48,
)
: IconButton( : IconButton(
icon: StreamSvgIcon.iconShare( icon: StreamSvgIcon.iconShare(
size: 24.0, size: 24.0,
@@ -63,6 +63,7 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
backgroundColor: backgroundColor:
StreamChatTheme.of(context).channelTheme.channelHeaderTheme.color, StreamChatTheme.of(context).channelTheme.channelHeaderTheme.color,
actions: <Widget>[ actions: <Widget>[
if (message.type != 'ephemeral')
IconButton( IconButton(
icon: StreamSvgIcon.iconMenuPoint( icon: StreamSvgIcon.iconMenuPoint(
color: StreamChatTheme.of(context).colorTheme.black, color: StreamChatTheme.of(context).colorTheme.black,
@@ -73,7 +74,8 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
), ),
], ],
centerTitle: true, centerTitle: true,
title: InkWell( title: message.type != 'ephemeral'
? InkWell(
onTap: onTitleTap, onTap: onTitleTap,
child: Container( child: Container(
height: preferredSize.height, height: preferredSize.height,
@@ -89,12 +91,15 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
), ),
Text( Text(
sentAt, sentAt,
style: StreamChatTheme.of(context).channelPreviewTheme.subtitle, style: StreamChatTheme.of(context)
.channelPreviewTheme
.subtitle,
), ),
], ],
), ),
), ),
), )
: SizedBox(),
); );
} }