diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 77b65b84..405f49f0 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -1,5 +1,8 @@ ## Upcoming +🐞 Fixed +[#1463](https://github.com/GetStream/stream-chat-flutter/pull/1463) Fixed support for iPad in the share button for images. + ✅ Added - Now it is possible to customize the max lines of the title of a url attachment. Before it was always 1 line. diff --git a/packages/stream_chat_flutter/lib/src/gallery/gallery_footer.dart b/packages/stream_chat_flutter/lib/src/gallery/gallery_footer.dart index c5cfad78..98ae7df2 100644 --- a/packages/stream_chat_flutter/lib/src/gallery/gallery_footer.dart +++ b/packages/stream_chat_flutter/lib/src/gallery/gallery_footer.dart @@ -60,6 +60,7 @@ class StreamGalleryFooter extends StatefulWidget class _StreamGalleryFooterState extends State { final shareButtonKey = GlobalKey(); + @override Widget build(BuildContext context) { const showShareButton = !kIsWeb; @@ -107,12 +108,19 @@ class _StreamGalleryFooterState extends State { await file.writeAsBytes(bytes); final box = shareButtonKey.currentContext?.findRenderObject(); + final size = shareButtonKey.currentContext?.size; + final position = (box! as RenderBox).localToGlobal(Offset.zero); + await Share.shareXFiles( [XFile(filePath)], - sharePositionOrigin: - Rect.fromLTWH(position.dx, position.dy, 0, 0), + sharePositionOrigin: Rect.fromLTWH( + position.dx, + position.dy, + size?.width ?? 50, + (size?.height ?? 2) / 2, + ), ); }, ),