showContextMenu method
Implementation
Future<String> showContextMenu(List<String> actions, num x, num y) {
completer = Completer();
modalStatePanel.onClick.listen((event) {
modalStatePanel.visible = false;
});
menuPanel.clear();
for (final action in actions) {
final actionElement = SimpleLabel()
..addCssClass('ContextMenuAction')
..caption = action;
actionElement.nodeRoot.onClick.listen((event) {
completer.complete(action);
closeMenu();
});
menuPanel.add(actionElement);
}
menuPanel.nodeRoot.style
..top = '${y}px'
..left = '${x}px';
modalStatePanel
..add(menuPanel)
..visible = true;
return completer.future;
}