Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ add offset parameter for box placement #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/src/widgets/reaction_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class ReactionButton<T> extends StatefulWidget {
this.boxColor = Colors.white,
this.boxElevation = 5,
this.boxRadius = 50,
this.boxOffset = Offset.zero,
this.isChecked = false,
this.itemsSpacing = 8,
this.itemScale = .3,
Expand Down Expand Up @@ -48,6 +49,9 @@ class ReactionButton<T> extends StatefulWidget {
/// Reactions box radius [default = 50]
final double boxRadius;

/// Reactions box offset [default = Offset.zero]
final Offset boxOffset;

/// Reactions box visibility duration [default = 200 milliseconds]
final Duration boxAnimationDuration;

Expand Down Expand Up @@ -118,7 +122,7 @@ class _ReactionButtonState<T> extends State<ReactionButton<T>> {
_overlayEntry = OverlayEntry(
builder: (context) {
return ReactionsBox<T>(
offset: offset ?? _globalKey.offset,
offset: (offset ?? _globalKey.offset) + widget.boxOffset,
itemSize: widget.itemSize,
reactions: widget.reactions,
color: widget.boxColor,
Expand Down