Skip to content

fix: Tooltip now correctly uses constructor-given style#1321

Open
jacksonb-cs wants to merge 2 commits intobdlukaa:masterfrom
jacksonb-cs:master
Open

fix: Tooltip now correctly uses constructor-given style#1321
jacksonb-cs wants to merge 2 commits intobdlukaa:masterfrom
jacksonb-cs:master

Conversation

@jacksonb-cs
Copy link
Copy Markdown
Contributor

Bug Fix: TooltipThemeData.waitDuration and others not affected by given widget style

Fixes #1320

Pre-launch Checklist

  • I have updated CHANGELOG.md with my changes
  • I have run "dart format ." on the project
  • I have added/updated relevant documentation

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request ensures that the Tooltip component correctly applies the style provided in its constructor by caching a merged theme and updating it within didUpdateWidget. It also includes a new test case to verify that the waitDuration property is respected. The review feedback suggests a logic improvement to restart the display timer if the waitDuration is modified while a tooltip is pending to ensure a consistent user experience.

Comment on lines +314 to +316
if (oldWidget.style != widget.style) {
_cacheTooltipTheme(context);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While updating the cached theme when the widget style changes is correct, if a tooltip is currently waiting to be shown (i.e., _showTimer is active), it will still use the old waitDuration. For a more consistent experience, consider canceling and restarting the timer if the waitDuration changes during didUpdateWidget.

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.

🐛 TooltipThemeData.waitDuration and others not affected by given widget style

1 participant