fix(ui): deprecate exposed showReactionPickerTail in MessageWidget

`showReactionPickerTail` property is bind with `showReactionPicker` as it is the only one needed to couple the reaction modal with the tail

Closes #1759
This commit is contained in:
Efthymis Sarmpanis
2023-11-02 15:08:53 +02:00
parent 354ae323b2
commit 02d686cc75
4 changed files with 118 additions and 12 deletions
@@ -60,7 +60,9 @@ class StreamMessageWidget extends StatefulWidget {
bool? showReactionPicker,
@Deprecated('Use `showReactionPicker` instead')
bool showReactionPickerIndicator = true,
@internal this.showReactionPickerTail = false,
@internal
@Deprecated('Use `showReactionPicker` instead')
this.showReactionPickerTail,
this.showUserAvatar = DisplayWidget.show,
this.showSendingIndicator = true,
this.showThreadReplyIndicator = false,
@@ -483,7 +485,8 @@ class StreamMessageWidget extends StatefulWidget {
/// Whether or not to show the reaction picker tail
/// {@endtemplate}
@internal
final bool showReactionPickerTail;
@Deprecated('Use `showReactionPicker` instead')
final bool? showReactionPickerTail;
/// {@template onShowMessage}
/// Callback when show message is tapped
@@ -743,8 +746,6 @@ class StreamMessageWidget extends StatefulWidget {
showReactionPicker: showReactionPicker ??
showReactionPickerIndicator ??
this.showReactionPicker,
showReactionPickerTail:
showReactionPickerTail ?? this.showReactionPickerTail,
onShowMessage: onShowMessage ?? this.onShowMessage,
showUsername: showUsername ?? this.showUsername,
showTimestamp: showTimestamp ?? this.showTimestamp,
@@ -1002,7 +1003,7 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
messageWidget: widget,
showBottomRow: showBottomRow,
showPinHighlight: widget.showPinHighlight,
showReactionPickerTail: widget.showReactionPickerTail,
showReactionPickerTail: widget.showReactionPicker,
showReactions: showReactions,
onReactionsTap: () {
widget.onReactionsTap != null
@@ -1217,7 +1218,8 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
translateUserAvatar: false,
showSendingIndicator: false,
padding: EdgeInsets.zero,
// Show the tail if the reaction picker is visible.
// Show both the tail if the picker is shown.
showReactionPicker: widget.showReactionPicker,
showReactionPickerTail: widget.showReactionPicker,
showPinHighlight: false,
showUserAvatar:
@@ -1258,6 +1260,7 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
return StreamChannel(
channel: channel,
child: MessageActionsModal(
showReactionPicker: widget.showReactionPicker,
messageWidget: widget.copyWith(
key: const Key('MessageWidget'),
message: widget.message.copyWith(
@@ -1271,9 +1274,6 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
translateUserAvatar: false,
showSendingIndicator: false,
padding: EdgeInsets.zero,
// Show both the tail if the picker is shown.
showReactionPicker: widget.showReactionPicker,
showReactionPickerTail: widget.showReactionPicker,
showPinHighlight: false,
showUserAvatar: widget.message.user!.id ==
channel.client.state.currentUser!.id