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
+2 -3
View File
@@ -48,9 +48,8 @@ class GiphyAttachment extends StatelessWidget {
}));
},
child: Hero(
tag: attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl,
tag:
'${message.id} - ${attachment.imageUrl ?? attachment.assetUrl ?? attachment.thumbUrl}',
child: CachedNetworkImage(
height: size?.height,
width: size?.width,
+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: (_) {
+1
View File
@@ -137,6 +137,7 @@ class MessageWidget extends StatefulWidget {
'image': (context, message, attachment) {
return ImageAttachment(
attachment: attachment,
message: message,
messageTheme: messageTheme,
size: Size(
MediaQuery.of(context).size.width * 0.8,
+1 -1
View File
@@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter
photo_view: ^0.9.2
rxdart: ^0.24.0
rxdart: ^0.24.1
jiffy: ^3.0.1
flutter_portal: ^0.1.0
cached_network_image: ^2.2.0+1