fix hero tag duplicated
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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: (_) {
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user