-
Notifications
You must be signed in to change notification settings - Fork 460
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
Calculation tooltip position #178
Calculation tooltip position #178
Conversation
4fc3280
to
e316d99
Compare
lib/src/tooltip_widget.dart
Outdated
@@ -82,7 +82,10 @@ class _ToolTipWidgetState extends State<ToolTipWidget> | |||
bool isCloseToTopOrBottom(Offset position) { | |||
var height = 120.0; | |||
height = widget.contentHeight ?? height; | |||
return (widget.screenSize!.height - position.dy) <= height; | |||
var bottomPosition = position.dy + (widget.position!.getHeight() / 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use final and handle the force unwrap
lib/src/tooltip_widget.dart
Outdated
@@ -82,7 +82,10 @@ class _ToolTipWidgetState extends State<ToolTipWidget> | |||
bool isCloseToTopOrBottom(Offset position) { | |||
var height = 120.0; | |||
height = widget.contentHeight ?? height; | |||
return (widget.screenSize!.height - position.dy) <= height; | |||
var bottomPosition = position.dy + (widget.position!.getHeight() / 2); | |||
var topPosition = position.dy - (widget.position!.getHeight() / 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use final and handle the force unwrap
lib/src/tooltip_widget.dart
Outdated
return (widget.screenSize!.height - position.dy) <= height; | ||
var bottomPosition = position.dy + (widget.position!.getHeight() / 2); | ||
var topPosition = position.dy - (widget.position!.getHeight() / 2); | ||
return (widget.screenSize!.height - bottomPosition) <= height && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle the force unwrap
c1ecbff
to
dc8ec69
Compare
dc8ec69
to
233ebc0
Compare
Compare widget position with bottom position instead of center position