我使用工具提示小部件,在其中我使用自定义小部件。工具提示出现在小部件下方。如何通过小部件将其放置在右侧?
class MenuItemWithTooltip extends StatelessWidget {
const MenuItemWithTooltip({
required this.item,
required this.title,
Key? key,
}) : super(key: key);
final MenuItem item;
final String title;
@override
Widget build(BuildContext context) {
return Tooltip(
decoration: BoxDecoration(
color: Theme.of(context).backgroundColor,
borderRadius: const BorderRadius.all(Radius.circular(3)),
),
margin: const EdgeInsets.only(left: 55),
textStyle: text12W400.copyWith(color: Colors.white),
child: item,
message: title,
);
}
}
Run Code Online (Sandbox Code Playgroud)