PopOverlay class

Main API for the pop overlay system

This class provides static methods and properties for:

  • Displaying pop overlays (addPop)
  • Dismissing overlays (removePop)
  • Checking overlay state (isActive)
  • Auto-installing the overlay system (internal)

Usage:

// Show a simple overlay
PopOverlay.addPop(PopOverlayContent(
  id: "notification_1",
  widget: MyNotificationWidget(),
));

// Dismiss a specific overlay
PopOverlay.removePop("notification_1");

Constructors

PopOverlay()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

activeIdsByStackOrder → List<String>
Returns active overlay IDs sorted by effective stack level (bottom to top).
no setter
controller → Injected<List<PopOverlayContent>>
Access to the underlying overlay controller
no setter
hiddenPopsController → Injected<List<String>>
no setter
invisibleController → Injected<List<String>>
Access to the invisible overlays controller for reactive updates
no setter
invisibleCount → int
The number of currently invisible overlays.
no setter
isActive → bool
Indicates whether any pop overlay is currently being shown
no setter
isActiveAndVisible → bool
Indicates whether any pop overlay is currently being shown and visible
no setter
performanceMetrics → Map<String, dynamic>
Performance monitoring - returns metrics about current overlays
no setter
template → Widget
Returns a default frame design pop overlay for testing
no setter
visibleCount → int
The number of currently visible overlays.
no setter

Static Methods

addPop(PopOverlayContent popContent, {BuildContext? context}) → void
Displays a pop overlay on screen
bringToFront(String id, {int step = 1}) → bool
Brings an active overlay above all current overlays.
clearAll() → void
Clear all overlays efficiently
closeButton(String popoverlayName) → Widget
dismissAllPops({bool includeInvisible = false, List<String> except = const []}) → void
Dismisses all active pop overlays, respecting each overlay's shouldMakeInvisibleOnDismiss setting.
dismissPop(String id) → void
Dismisses a popup respecting its shouldMakeInvisibleOnDismiss setting
getActiveById(String id) → PopOverlayContent?
getInvisiblePops() → List<PopOverlayContent>
Returns only the currently invisible overlays.
getStackLevel(String id) → int?
Returns the current stack level for an active overlay ID.
getVisiblePops() → List<PopOverlayContent>
Returns only the currently visible (non-invisible) overlays.
infoButton({required String popContentId, required String info}) → Widget
isActiveById(String id) → bool
isVisibleById(String id) → bool
Returns true if the overlay with id is both active and currently visible (i.e. not in the invisible list).
removeMultiplePops(List<String> ids) → void
Batch removal of multiple overlays for better performance
removePop(String id) → void
Dismisses a specific pop overlay by ID
replacePop(String id, PopOverlayContent newContent) → void
Atomically replaces an existing overlay with a new one.
sendToBack(String id, {int step = 1}) → bool
Sends an active overlay below all current overlays.
setStackLevel(String id, int stackLevel) → bool
Sets stack level for an active overlay by ID.