Skip to content

Commit

Permalink
add positioningStrategy to ReactionButton
Browse files Browse the repository at this point in the history
  • Loading branch information
julek-kal committed Oct 26, 2023
1 parent 8129e9b commit 3e030f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/widgets/reaction_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ReactionButton<T> 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.
Expand Down Expand Up @@ -66,6 +67,9 @@ class ReactionButton<T> 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;
Expand Down Expand Up @@ -127,6 +131,7 @@ class _ReactionButtonState<T> extends State<ReactionButton<T>> {
itemScale: widget.itemScale,
itemScaleDuration: widget.itemAnimationDuration,
animateBox: widget.animateBox,
positioningStrategy: widget.positioningStrategy,
onReactionSelected: (reaction) {
_updateReaction(reaction);
_disposeOverlayEntry();
Expand Down

0 comments on commit 3e030f7

Please sign in to comment.