Merge branch 'develop' into v4

This commit is contained in:
Salvatore Giordano
2022-03-21 10:11:18 +01:00
3 changed files with 16 additions and 1 deletions
@@ -10,6 +10,12 @@
- Mentions overlay now doesn't overflow when there is not enough height available
- Updated `stream_chat_flutter_core` dependency to [`3.5.1`](https://pub.dev/packages/stream_chat_flutter_core/changelog).
✅ Added
- `onLinkTap` for `MessageWidget` can now be passed down to `UrlAttachment`.
## 3.5.0
🐞 Fixed
@@ -20,6 +20,7 @@ class StreamUrlAttachment extends StatelessWidget {
horizontal: 16,
vertical: 8,
),
this.onLinkTap,
}) : super(key: key);
/// Attachment to be displayed
@@ -34,13 +35,20 @@ class StreamUrlAttachment extends StatelessWidget {
/// [StreamMessageThemeData] for showing image title
final StreamMessageThemeData messageTheme;
/// The function called when tapping on a link
final void Function(String)? onLinkTap;
@override
Widget build(BuildContext context) {
final chatThemeData = StreamChatTheme.of(context);
return GestureDetector(
onTap: () {
final titleLink = urlAttachment.titleLink;
if (titleLink != null) launchURL(context, titleLink);
if (titleLink != null) {
onLinkTap != null
? onLinkTap!(titleLink)
: launchURL(context, titleLink);
}
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -1019,6 +1019,7 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
hostDisplayName: hostDisplayName,
textPadding: widget.textPadding,
messageTheme: widget.messageTheme,
onLinkTap: widget.onLinkTap,
);
}