From 3e030f79bf8e9df53ca83c9eee0a657cc7cccf3d Mon Sep 17 00:00:00 2001 From: Julian Kalinowski Date: Thu, 26 Oct 2023 05:12:47 +0200 Subject: [PATCH] add positioningStrategy to ReactionButton --- lib/src/widgets/reaction_button.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/widgets/reaction_button.dart b/lib/src/widgets/reaction_button.dart index 24cf855..769dd6a 100644 --- a/lib/src/widgets/reaction_button.dart +++ b/lib/src/widgets/reaction_button.dart @@ -25,6 +25,7 @@ class ReactionButton extends StatefulWidget { this.itemAnimationDuration = const Duration(milliseconds: 100), this.hoverDuration = const Duration(milliseconds: 400), this.child, + this.positioningStrategy = const TryStayInBoundariesStrategy(), }) : _type = child != null ? ReactionType.container : ReactionType.button; /// This triggers when reaction button value changed. @@ -66,6 +67,9 @@ class ReactionButton extends StatefulWidget { /// Animation duration while moving [default = const Duration(milliseconds: 100)] final Duration itemAnimationDuration; + /// Reaction box positioning strategy [default = const TryStayInBoundariesStrategy()] + final ReactionBoxPositioningStrategy positioningStrategy; + final Size itemSize; final bool animateBox; @@ -127,6 +131,7 @@ class _ReactionButtonState extends State> { itemScale: widget.itemScale, itemScaleDuration: widget.itemAnimationDuration, animateBox: widget.animateBox, + positioningStrategy: widget.positioningStrategy, onReactionSelected: (reaction) { _updateReaction(reaction); _disposeOverlayEntry();