fix hero tag duplicated
This commit is contained in:
@@ -48,9 +48,8 @@ class GiphyAttachment extends StatelessWidget {
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
child: Hero(
|
child: Hero(
|
||||||
tag: attachment.imageUrl ??
|
tag:
|
||||||
attachment.assetUrl ??
|
'${message.id} - ${attachment.imageUrl ?? attachment.assetUrl ?? attachment.thumbUrl}',
|
||||||
attachment.thumbUrl,
|
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
height: size?.height,
|
height: size?.height,
|
||||||
width: size?.width,
|
width: size?.width,
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ import 'utils.dart';
|
|||||||
|
|
||||||
class ImageAttachment extends StatelessWidget {
|
class ImageAttachment extends StatelessWidget {
|
||||||
final Attachment attachment;
|
final Attachment attachment;
|
||||||
|
final Message message;
|
||||||
final MessageTheme messageTheme;
|
final MessageTheme messageTheme;
|
||||||
final Size size;
|
final Size size;
|
||||||
|
|
||||||
const ImageAttachment({
|
const ImageAttachment({
|
||||||
Key key,
|
Key key,
|
||||||
this.attachment,
|
@required this.attachment,
|
||||||
|
@required this.message,
|
||||||
this.messageTheme,
|
this.messageTheme,
|
||||||
this.size,
|
this.size,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
@@ -36,9 +38,8 @@ class ImageAttachment extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Hero(
|
child: Hero(
|
||||||
tag: attachment.imageUrl ??
|
tag:
|
||||||
attachment.assetUrl ??
|
'${message.id} - ${attachment.imageUrl ?? attachment.assetUrl ?? attachment.thumbUrl}',
|
||||||
attachment.thumbUrl,
|
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(context, MaterialPageRoute(builder: (_) {
|
Navigator.push(context, MaterialPageRoute(builder: (_) {
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ class MessageWidget extends StatefulWidget {
|
|||||||
'image': (context, message, attachment) {
|
'image': (context, message, attachment) {
|
||||||
return ImageAttachment(
|
return ImageAttachment(
|
||||||
attachment: attachment,
|
attachment: attachment,
|
||||||
|
message: message,
|
||||||
messageTheme: messageTheme,
|
messageTheme: messageTheme,
|
||||||
size: Size(
|
size: Size(
|
||||||
MediaQuery.of(context).size.width * 0.8,
|
MediaQuery.of(context).size.width * 0.8,
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
photo_view: ^0.9.2
|
photo_view: ^0.9.2
|
||||||
rxdart: ^0.24.0
|
rxdart: ^0.24.1
|
||||||
jiffy: ^3.0.1
|
jiffy: ^3.0.1
|
||||||
flutter_portal: ^0.1.0
|
flutter_portal: ^0.1.0
|
||||||
cached_network_image: ^2.2.0+1
|
cached_network_image: ^2.2.0+1
|
||||||
|
|||||||
Reference in New Issue
Block a user