overlays property

OverlayManager overlays

A property that stores an OverlayManager

This is useful to render widgets on top of a game, such as a pause menu. Overlays can be made visible via overlays.add or hidden via overlays.remove.

For example:

final pauseOverlayIdentifier = 'PauseMenu';
overlays.add(pauseOverlayIdentifier); // marks 'PauseMenu' to be rendered.
overlays.remove(pauseOverlayIdentifier); // hides 'PauseMenu'.


late final overlays = OverlayManager(this);