fix hero tag duplicated

This commit is contained in:
Salvatore Giordano
2020-05-16 12:29:00 +02:00
parent e8be4a2575
commit 890f729668
4 changed files with 9 additions and 8 deletions
+5 -4
View File
@@ -9,12 +9,14 @@ import 'utils.dart';
class ImageAttachment extends StatelessWidget {
final Attachment attachment;
final Message message;
final MessageTheme messageTheme;
final Size size;
const ImageAttachment({
Key key,
this.attachment,
@required this.attachment,
@required this.message,
this.messageTheme,
this.size,
}) : super(key: key);
@@ -36,9 +38,8 @@ class ImageAttachment extends StatelessWidget {
children: <Widget>[
Expanded(
child: Hero(
tag: attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl,
tag:
'${message.id} - ${attachment.imageUrl ?? attachment.assetUrl ?? attachment.thumbUrl}',
child: GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (_) {