Skip to content

Commit

Permalink
feat(app): add Sinai tooltip version
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 18, 2024
1 parent d259a7c commit fc76c34
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions app/lib/drug/widgets/tooltip_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,28 @@ class TooltipIcon extends StatelessWidget {

@override
Widget build(BuildContext context) {
final tooltipKey = GlobalKey<TooltipState>();
return Tooltip(
key: tooltipKey,
message: message,
margin: EdgeInsets.all(PharMeTheme.smallSpace),
triggerMode: TooltipTriggerMode.tap,
showDuration: const Duration(seconds: 3),
child: Icon(Icons.help_outline_rounded, size: size),
margin: EdgeInsets.symmetric(horizontal: PharMeTheme.smallSpace),
triggerMode: TooltipTriggerMode.manual,
child: SizedBox(
height: size + PharMeTheme.smallSpace,
width: size + PharMeTheme.smallSpace,
child: IconButton(
padding: EdgeInsets.zero,
onPressed: () => tooltipKey.currentState?.ensureTooltipVisible(),
icon: Icon(
Icons.help_outline_rounded,
size: size,
color: PharMeTheme.iconColor,
),
style: ButtonStyle(
fixedSize: WidgetStateProperty.all(Size.fromHeight(size)),
),
),
),
);
}
}

0 comments on commit fc76c34

Please sign in to comment.