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

fix: Added contentdxOffset #80

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 6 additions & 0 deletions lib/src/popover.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ import 'utils/popover_utils.dart';
/// position on Y axis. It can be positive or negative number.
/// This argument defaults to 0.
///
/// The`contentDxOffset` offsets [Popover]s content
/// position on X axis. It can be positive or negative number.
/// This argument defaults to 0.
///
/// The `barrierDismissible` argument is used to determine whether this route
/// can be dismissed by tapping the modal barrier. This argument defaults
/// to true.
Expand Down Expand Up @@ -88,6 +92,7 @@ Future<T?> showPopover<T extends Object?>({
double arrowDxOffset = 0,
double arrowDyOffset = 0,
double contentDyOffset = 0,
double contentDxOffset = 0,
bool barrierDismissible = true,
double? width,
double? height,
Expand Down Expand Up @@ -131,6 +136,7 @@ Future<T?> showPopover<T extends Object?>({
arrowDxOffset: arrowDxOffset,
arrowDyOffset: arrowDyOffset,
contentDyOffset: contentDyOffset,
contentDxOffset: contentDxOffset,
key: key,
),
);
Expand Down
4 changes: 3 additions & 1 deletion lib/src/popover_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class PopoverItem extends StatefulWidget {
final double arrowDxOffset;
final double arrowDyOffset;
final double contentDyOffset;
final double contentDxOffset;
final PopoverTransition transition;

const PopoverItem({
Expand All @@ -36,6 +37,7 @@ class PopoverItem extends StatefulWidget {
this.arrowDxOffset = 0,
this.arrowDyOffset = 0,
this.contentDyOffset = 0,
this.contentDxOffset = 0,
super.key,
});

Expand Down Expand Up @@ -142,7 +144,7 @@ class _PopoverItemState extends State<PopoverItem> {
_attachRect = Rect.fromLTWH(
offset.dx + (widget.arrowDxOffset),
offset.dy + (widget.arrowDyOffset),
bounds.width,
bounds.width + (widget.contentDxOffset),
bounds.height + (widget.contentDyOffset),
);
}
Expand Down
Loading