fix: fix overlay reactions bouncing around (#5031)
This commit is contained in:
parent
3cd387cc13
commit
a6b522529d
2 changed files with 13 additions and 14 deletions
|
|
@ -20,11 +20,13 @@ class PangeaMessageReactions extends StatefulWidget {
|
|||
final Event event;
|
||||
final Timeline timeline;
|
||||
final ChatController controller;
|
||||
final double? maxWidth;
|
||||
|
||||
const PangeaMessageReactions(
|
||||
this.event,
|
||||
this.timeline,
|
||||
this.controller, {
|
||||
this.maxWidth,
|
||||
super.key,
|
||||
});
|
||||
|
||||
|
|
@ -120,13 +122,12 @@ class _PangeaMessageReactionsState extends State<PangeaMessageReactions> {
|
|||
.aggregatedEvents(widget.timeline, RelationshipTypes.reaction)
|
||||
.toList();
|
||||
|
||||
return Directionality(
|
||||
textDirection: ownMessage ? TextDirection.rtl : TextDirection.ltr,
|
||||
child: AnimatedSize(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
alignment: ownMessage ? Alignment.bottomRight : Alignment.bottomLeft,
|
||||
clipBehavior: Clip.none,
|
||||
return SizedBox(
|
||||
width: allReactionEvents.any((e) => e.status.isSending)
|
||||
? null
|
||||
: widget.maxWidth,
|
||||
child: Directionality(
|
||||
textDirection: ownMessage ? TextDirection.rtl : TextDirection.ltr,
|
||||
child: Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
runSpacing: 4.0,
|
||||
|
|
|
|||
|
|
@ -96,13 +96,11 @@ class OverlayCenterContent extends StatelessWidget {
|
|||
top: 4.0,
|
||||
left: ownMessage ? 0.0 : 4.0,
|
||||
),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: reactionsWidth ?? 0.0),
|
||||
child: PangeaMessageReactions(
|
||||
event,
|
||||
chatController.timeline!,
|
||||
chatController,
|
||||
),
|
||||
child: PangeaMessageReactions(
|
||||
event,
|
||||
chatController.timeline!,
|
||||
chatController,
|
||||
maxWidth: reactionsWidth ?? 0.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue