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 a close button to the tooltip in Onboarding #4619

Merged
merged 8 commits into from
Sep 6, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -149,30 +149,44 @@ class _KnowledgePanelPageTemplateState
);

List<Widget> _buildHintPopup() {
final Widget hintPopup = InkWell(
final Widget hintPopup = Card(
Copy link
Contributor

Choose a reason for hiding this comment

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

We still need the whole tooltip to be closable by click. The cross icon is just to tell the user "btw you can close this tooltip" (but you can click anywhere).
Besides if you want an icon to be clickable, you're supposed to make it "big enough" (something like 48) and it would be too big for the tooltip.

key: const Key('toolTipPopUp'),
child: Card(
margin: const EdgeInsets.symmetric(horizontal: 30),
color: Theme.of(context).hintColor.withOpacity(0.9),
shape: const TooltipShapeBorder(arrowArc: 0.5),
child: Container(
margin: const EdgeInsetsDirectional.only(
start: VERY_LARGE_SPACE,
top: 10,
end: VERY_LARGE_SPACE,
bottom: 10,
),
child: Text(
appLocalizations.hint_knowledge_panel_message,
style: TextStyle(color: Theme.of(context).cardColor),
),
margin: const EdgeInsets.symmetric(horizontal: 30),
color: Theme.of(context).hintColor.withOpacity(0.9),
shape: const TooltipShapeBorder(arrowArc: 0.5),
child: Container(
margin: const EdgeInsetsDirectional.only(
start: VERY_LARGE_SPACE,
top: 10,
end: 10,
bottom: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: Text(
appLocalizations.hint_knowledge_panel_message,
style: TextStyle(color: Theme.of(context).cardColor),
),
),
const SizedBox(width: VERY_LARGE_SPACE),
InkWell(
onTap: () {
setState(() {
_isHintDismissed = true;
});
},
splashColor: Theme.of(context).splashColor,
child: const Icon(
Icons.close,
color: WHITE_COLOR,
monsieurtanuki marked this conversation as resolved.
Show resolved Hide resolved
// size: LARGE_SPACE,
),
),
],
),
),
onTap: () {
setState(() {
_isHintDismissed = true;
});
},
);
final List<Widget> hitPopup = <Widget>[];
if (!_isHintDismissed &&
Expand Down