diff --git a/packages/stream_chat_flutter/lib/src/message_list_view.dart b/packages/stream_chat_flutter/lib/src/message_list_view.dart index 6e61612b..69f10d68 100644 --- a/packages/stream_chat_flutter/lib/src/message_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/message_list_view.dart @@ -142,7 +142,6 @@ class MessageListView extends StatefulWidget { this.parentMessage, this.threadBuilder, this.onThreadTap, - this.onReplyTap, this.dateDividerBuilder, this.scrollPhysics = const ClampingScrollPhysics(), this.initialScrollIndex, @@ -152,7 +151,6 @@ class MessageListView extends StatefulWidget { this.onMessageSwiped, this.highlightInitialMessage = false, this.messageHighlightColor, - this.onShowMessage, this.showConnectionStateTile = false, this.headerBuilder, this.footerBuilder, @@ -160,16 +158,11 @@ class MessageListView extends StatefulWidget { this.emptyBuilder, this.systemMessageBuilder, this.messageListBuilder, - this.errorWidgetBuilder, + this.errorBuilder, this.messageFilter, - this.customAttachmentBuilders, this.onMessageTap, this.onSystemMessageTap, - this.onAttachmentTap, - this.onLinkTap, this.pinPermissions = const [], - this.textBuilder, - this.usernameBuilder, this.showFloatingDateDivider = true, this.threadSeparatorBuilder, this.messageListController, @@ -222,9 +215,6 @@ class MessageListView extends StatefulWidget { /// Called when message item gets swiped final OnMessageSwiped? onMessageSwiped; - /// - final ReplyTapCallback? onReplyTap; - /// If true the list will highlight the initialMessage if there is any. /// /// Also See [StreamChannel] @@ -233,9 +223,6 @@ class MessageListView extends StatefulWidget { /// Color used while highlighting initial message final Color? messageHighlightColor; - /// Callback when show message is tapped - final ShowMessageCallback? onShowMessage; - /// Flag for showing tile on header final bool showConnectionStateTile; @@ -262,16 +249,11 @@ class MessageListView extends StatefulWidget { /// This parameter can be used to display an error message to /// users in the event /// of a connection failure. - final ErrorBuilder? errorWidgetBuilder; + final ErrorBuilder? errorBuilder; /// Predicate used to filter messages final bool Function(Message)? messageFilter; - /// Attachment builders for the default message widget - /// Please change this in the [MessageWidget] if you are using a - /// custom implementation - final Map? customAttachmentBuilders; - /// Called when any message is tapped except a system message /// (use [onSystemMessageTap] instead) final OnMessageTap? onMessageTap; @@ -279,18 +261,6 @@ class MessageListView extends StatefulWidget { /// Called when system message is tapped final OnMessageTap? onSystemMessageTap; - /// Customize onTap on attachment - final void Function(Message message, Attachment attachment)? onAttachmentTap; - - /// Customize the MessageWidget textBuilder - final Widget Function(BuildContext context, Message message)? textBuilder; - - /// Customize the MessageWidget usernameBuilder - final Widget Function(BuildContext context, Message message)? usernameBuilder; - - /// Callback for when link is tapped - final void Function(String link)? onLinkTap; - /// A List of user types that have permission to pin messages final List pinPermissions; @@ -376,7 +346,7 @@ class _MessageListViewState extends State { (context, list) => _buildListView(list), messageListController: _messageListController, parentMessage: widget.parentMessage, - errorWidgetBuilder: widget.errorWidgetBuilder ?? + errorBuilder: widget.errorBuilder ?? (BuildContext context, Object error) => Center( child: Text( 'Something went wrong', @@ -823,7 +793,6 @@ class _MessageListViewState extends State { showUsername: !isMyMessage, padding: const EdgeInsets.all(8), showSendingIndicator: false, - onThreadTap: _onThreadTap, borderRadiusGeometry: BorderRadius.only( topLeft: const Radius.circular(16), bottomLeft: @@ -841,7 +810,6 @@ class _MessageListViewState extends State { messageTheme: isMyMessage ? _streamTheme.ownMessageTheme : _streamTheme.otherMessageTheme, - onShowMessage: widget.onShowMessage, onReturnAction: (action) { switch (action) { case ReturnActionType.none: @@ -852,16 +820,12 @@ class _MessageListViewState extends State { break; } }, - customAttachmentBuilders: widget.customAttachmentBuilders, onMessageTap: (message) { if (widget.onMessageTap != null) { widget.onMessageTap!(message); } FocusScope.of(context).unfocus(); }, - textBuilder: widget.textBuilder, - usernameBuilder: widget.usernameBuilder, - onLinkTap: widget.onLinkTap, showPinButton: currentUserMember != null && widget.pinPermissions.contains(currentUserMember.role), ); @@ -1004,7 +968,6 @@ class _MessageListViewState extends State { showFlagButton: !isMyMessage, borderSide: borderSide, onThreadTap: _onThreadTap, - onReplyTap: widget.onReplyTap, attachmentBorderRadiusGeometry: BorderRadius.only( topLeft: Radius.circular(attachmentBorderRadius), bottomLeft: isMyMessage @@ -1055,7 +1018,6 @@ class _MessageListViewState extends State { : _streamTheme.otherMessageTheme, readList: readList, allRead: allRead, - onShowMessage: widget.onShowMessage, onReturnAction: (action) { switch (action) { case ReturnActionType.none: @@ -1066,17 +1028,12 @@ class _MessageListViewState extends State { break; } }, - customAttachmentBuilders: widget.customAttachmentBuilders, onMessageTap: (message) { if (widget.onMessageTap != null) { widget.onMessageTap!(message); } FocusScope.of(context).unfocus(); }, - onAttachmentTap: widget.onAttachmentTap, - textBuilder: widget.textBuilder, - usernameBuilder: widget.usernameBuilder, - onLinkTap: widget.onLinkTap, showPinButton: widget.pinPermissions.contains(currentUserMember.role), ); diff --git a/packages/stream_chat_flutter_core/lib/src/message_list_core.dart b/packages/stream_chat_flutter_core/lib/src/message_list_core.dart index 2a259e83..dc90cc91 100644 --- a/packages/stream_chat_flutter_core/lib/src/message_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/message_list_core.dart @@ -40,7 +40,7 @@ import 'package:stream_chat_flutter_core/src/typedef.dart'; /// messageListBuilder: (context, list) { /// return MessagesPage(list); /// }, -/// errorWidgetBuilder: (context, err) { +/// errorBuilder: (context, err) { /// return Center( /// child: Text('Error'), /// ); @@ -67,7 +67,7 @@ class MessageListCore extends StatefulWidget { required this.loadingBuilder, required this.emptyBuilder, required this.messageListBuilder, - required this.errorWidgetBuilder, + required this.errorBuilder, this.parentMessage, this.messageListController, this.messageFilter, @@ -91,7 +91,7 @@ class MessageListCore extends StatefulWidget { /// /// This parameter can be used to display an error message to users in the /// event of a connection failure. - final ErrorBuilder errorWidgetBuilder; + final ErrorBuilder errorBuilder; /// If the current message belongs to a `thread`, this property represents the /// first message or the parent of the conversation. @@ -144,7 +144,7 @@ class MessageListCoreState extends State { growable: false, ), ), - errorBuilder: widget.errorWidgetBuilder, + errorBuilder: widget.errorBuilder, loadingBuilder: widget.loadingBuilder, builder: (context, data) { final messageList = data?.reversed.toList(growable: false) ?? [];