fix video attachment fullscreen

This commit is contained in:
Salvatore Giordano
2020-05-13 15:51:45 +02:00
parent 4dcdc457f4
commit a1a3cb177d
8 changed files with 142 additions and 69 deletions
+51 -45
View File
@@ -32,55 +32,61 @@ class ImageAttachment extends StatelessWidget {
size: size,
child: Stack(
children: <Widget>[
Hero(
tag: attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl,
child: GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (_) {
return FullScreenImage(
url: attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl,
);
}));
},
child: CachedNetworkImage(
height: size?.height,
width: size?.width,
placeholder: (_, __) {
return Container(
width: size?.width,
height: size?.height,
child: Center(
child: CircularProgressIndicator(),
Column(
children: <Widget>[
Expanded(
child: Hero(
tag: attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl,
child: GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (_) {
return FullScreenImage(
url: attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl,
);
}));
},
child: CachedNetworkImage(
height: size?.height,
width: size?.width,
placeholder: (_, __) {
return Container(
width: size?.width,
height: size?.height,
child: Center(
child: CircularProgressIndicator(),
),
);
},
imageUrl: attachment.thumbUrl ??
attachment.imageUrl ??
attachment.assetUrl,
errorWidget: (context, url, error) => AttachmentError(
attachment: attachment,
size: size,
),
fit: BoxFit.cover,
),
);
},
imageUrl: attachment.thumbUrl ??
attachment.imageUrl ??
attachment.assetUrl,
errorWidget: (context, url, error) => AttachmentError(
attachment: attachment,
size: size,
),
fit: BoxFit.cover,
),
),
),
if (attachment.title != null)
Positioned.fill(
child: Align(
alignment: Alignment.bottomCenter,
child: Material(
child: AttachmentTitle(
messageTheme: messageTheme,
attachment: attachment,
),
),
),
),
if (attachment.title != null)
Positioned.fill(
child: Align(
alignment: Alignment.bottomCenter,
child: Material(
child: AttachmentTitle(
messageTheme: messageTheme,
attachment: attachment,
),
),
),
),
],
),
if (attachment.titleLink != null || attachment.ogScrapeUrl != null)
Positioned.fill(
child: Material(