[Image Attachment] Add a property to hide/show image title
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -193,6 +193,7 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
|||||||
? ImageAttachment(
|
? ImageAttachment(
|
||||||
attachment: media[position].attachment,
|
attachment: media[position].attachment,
|
||||||
message: media[position].message,
|
message: media[position].message,
|
||||||
|
showTitle: false,
|
||||||
size: Size(
|
size: Size(
|
||||||
MediaQuery.of(context).size.width * 0.8,
|
MediaQuery.of(context).size.width * 0.8,
|
||||||
MediaQuery.of(context).size.height * 0.3,
|
MediaQuery.of(context).size.height * 0.3,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class ImageAttachment extends StatelessWidget {
|
|||||||
final Message message;
|
final Message message;
|
||||||
final MessageTheme messageTheme;
|
final MessageTheme messageTheme;
|
||||||
final Size size;
|
final Size size;
|
||||||
|
final bool showTitle;
|
||||||
|
|
||||||
const ImageAttachment({
|
const ImageAttachment({
|
||||||
Key key,
|
Key key,
|
||||||
@@ -19,6 +20,7 @@ class ImageAttachment extends StatelessWidget {
|
|||||||
@required this.message,
|
@required this.message,
|
||||||
@required this.size,
|
@required this.size,
|
||||||
this.messageTheme,
|
this.messageTheme,
|
||||||
|
this.showTitle = true,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -83,7 +85,7 @@ class ImageAttachment extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (attachment.title != null)
|
if (showTitle && attachment.title != null)
|
||||||
Material(
|
Material(
|
||||||
color: messageTheme.messageBackgroundColor,
|
color: messageTheme.messageBackgroundColor,
|
||||||
child: AttachmentTitle(
|
child: AttachmentTitle(
|
||||||
@@ -93,7 +95,8 @@ class ImageAttachment extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (attachment.titleLink != null || attachment.ogScrapeUrl != null)
|
if (showTitle &&
|
||||||
|
(attachment.titleLink != null || attachment.ogScrapeUrl != null))
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
|
|||||||
Reference in New Issue
Block a user