在 flutter 中将箭头对齐到 super_tooltip 的右侧
Align arrowhead to right of the super_tooltip in flutter
我使用 super_tooltip 包来创建我的工具提示。在这里我想改变工具提示箭头的位置。我该怎么做? (如下图 - 蓝色箭头)
tooltip = SuperTooltip(
popupDirection: TooltipDirection.down,
arrowBaseWidth: 15.0,
arrowLength: 20.0,
borderColor: Colors.white,
borderRadius: 0,
hasShadow: false,
minimumOutSidePadding: 10,
content: new Material(
child: Text(
"Lorem ipsum dolor sit amet, consetetur sadipscingelitr, "
softWrap: true,
)),
);
SuperTooltip 使用传递的上下文来确定目标中心。因此,要解决此问题,您可以将该按钮包装在构建器中并将其上下文传递给显示函数:
Builder(
builder: (childContext) => IconButton(
onPressed: () {
tooltip.show(childContext);
},
icon: const Icon(Icons.info_rounded),
),
),
阅读更多关于 Builder
我使用 super_tooltip 包来创建我的工具提示。在这里我想改变工具提示箭头的位置。我该怎么做? (如下图 - 蓝色箭头)
tooltip = SuperTooltip(
popupDirection: TooltipDirection.down,
arrowBaseWidth: 15.0,
arrowLength: 20.0,
borderColor: Colors.white,
borderRadius: 0,
hasShadow: false,
minimumOutSidePadding: 10,
content: new Material(
child: Text(
"Lorem ipsum dolor sit amet, consetetur sadipscingelitr, "
softWrap: true,
)),
);
SuperTooltip 使用传递的上下文来确定目标中心。因此,要解决此问题,您可以将该按钮包装在构建器中并将其上下文传递给显示函数:
Builder(
builder: (childContext) => IconButton(
onPressed: () {
tooltip.show(childContext);
},
icon: const Icon(Icons.info_rounded),
),
),
阅读更多关于 Builder