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

Calculation tooltip position #178

Conversation

faiyaz-shaikh
Copy link
Contributor

Compare widget position with bottom position instead of center position

@faiyaz-shaikh faiyaz-shaikh force-pushed the fix/tooltip_position_calculation branch from 4fc3280 to e316d99 Compare February 24, 2022 14:36
@vatsaltanna vatsaltanna linked an issue Feb 24, 2022 that may be closed by this pull request
@@ -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);
Copy link
Collaborator

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

@@ -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);
Copy link
Collaborator

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

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 &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handle the force unwrap

@faiyaz-shaikh faiyaz-shaikh force-pushed the fix/tooltip_position_calculation branch 2 times, most recently from c1ecbff to dc8ec69 Compare February 25, 2022 08:10
@faiyaz-shaikh faiyaz-shaikh force-pushed the fix/tooltip_position_calculation branch from dc8ec69 to 233ebc0 Compare February 25, 2022 08:15
@vatsaltanna vatsaltanna merged commit 375cf71 into SimformSolutionsPvtLtd:master Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom tooltip position
2 participants