Excellent question.
getFlyout is actually defined on WorkspaceSvg, rather than the parent class of Workspace. Here's the code:
Unless you are using headless stuff in node.js, every workspace you encounter will be a WorkspaceSvg, not just a Workspace. Likewise, every block you encounter will be a BlockSvg, not just a Block. So that's why the documentation for Workspace doesn't list getFlyout.
However the
documentation for WorkspaceSvg also doesn't list getFlyout! This is because this method (as well as many others) has the '@internal' annotation, which stops it from being documented. The intent is that we don't want to spam the documentation with a ton of functions that nobody would use (for example WorkspaceSvg.
setMetricsManager). But there are definitely some that are miscategorized. I'll remove the @internal annotation from
WorkspaceSvg.getFlyout, WorkspaceSvg.getToolbox, and Flyout.getWorkspace
right now.
So in summary:
1) Don't forget to check the SVG subclasses of Block and Workspace when checking the API.
2) Use the source when you are digging into the more obscure areas of Blockly.