Merge pull request #405 from GetStream/expose-link

feat: add onLinkTap
This commit is contained in:
Salvatore Giordano
2021-04-26 15:59:30 +02:00
committed by GitHub
@@ -142,6 +142,7 @@ class MessageListView extends StatefulWidget {
this.onSystemMessageTap, this.onSystemMessageTap,
this.onAttachmentTap, this.onAttachmentTap,
this.textBuilder, this.textBuilder,
this.onLinkTap,
}) : super(key: key); }) : super(key: key);
/// Function used to build a custom message widget /// Function used to build a custom message widget
@@ -237,6 +238,8 @@ class MessageListView extends StatefulWidget {
/// Customize the MessageWidget textBuilder /// Customize the MessageWidget textBuilder
final void Function(BuildContext context, Message message) textBuilder; final void Function(BuildContext context, Message message) textBuilder;
final void Function(String link) onLinkTap;
@override @override
_MessageListViewState createState() => _MessageListViewState(); _MessageListViewState createState() => _MessageListViewState();
} }
@@ -844,6 +847,7 @@ class _MessageListViewState extends State<MessageListView> {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
}, },
textBuilder: widget.textBuilder, textBuilder: widget.textBuilder,
onLinkTap: widget.onLinkTap,
); );
} }
@@ -1021,6 +1025,7 @@ class _MessageListViewState extends State<MessageListView> {
}, },
onAttachmentTap: widget.onAttachmentTap, onAttachmentTap: widget.onAttachmentTap,
textBuilder: widget.textBuilder, textBuilder: widget.textBuilder,
onLinkTap: widget.onLinkTap,
); );
if (!message.isDeleted && if (!message.isDeleted &&