build method
Implementation
@override
Widget build(BuildContext context, AdaptiveContextMenu component) {
return _ContextMenuRegion(
contextMenuBuilder: (BuildContext context, Offset offset) {
return TapRegion(
onTapOutside: (tap) {
if (kIsWeb) {
BrowserContextMenu.enableContextMenu();
}
ContextMenuController.removeAny();
},
child: toolbar(context, offset, [
for (int i = 0; i < component.actions.length; i++) ...[
FlyoutListTile(
onPressed: () {
ContextMenuController.removeAny();
if (kIsWeb) {
BrowserContextMenu.enableContextMenu();
}
component.actions[i].onPressed?.call();
},
text: SizedBox(
width: double.infinity,
child: Text(component.actions[i].text))),
]
]),
);
},
child: component.child,
);
}