overlays property

ActiveOverlaysNotifier overlays
finalinherited

A property that stores an ActiveOverlaysNotifier

This is useful to render widgets above a game, like a pause menu for example. Overlays visible or hidden via overlays.add or overlays.remove, respectively.

Ex:

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

See also:

  • GameWidget
  • Game.overlays

Implementation

final overlays = ActiveOverlaysNotifier();