PopupState class

The internal state (model) of a popup.

Changes to the model may impact a rendered popup if it is open, otherwise it is treated as a property bag. Listen to changes (AutoObservable) to be notified when a property changes;

Constructors

PopupState({bool autoDismiss = true, bool enforceSpaceConstraints = false, bool matchMinSourceWidth = false, int offsetX = 0, int offsetY = 0, Iterable<Object> preferredPositions = const [], PopupSource? source, bool trackLayoutChanges = true, bool constrainToViewport = true})
Create a new, empty popup state (with defaults).
factory
PopupState.from(PopupState other)
Create a new popup state from other.
factory

Properties

autoDismiss bool
If set to true, the popup should attempt to close itself when a mouse click or finger tap is detected outside of the bounds of the popup.
getter/setter pair
changes Stream<List<ChangeRecord>>
Emits a list of changes when the state of the object changes.
no setter
constrainToViewport bool
getter/setter pair
enforceSpaceConstraints bool
If true, the popup will attempt to make intelligent decisions about positioning and layout depending on the size of the inner content and the distance to the viewport edges.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
hasObservers bool
True if this object has any observers.
no setterinherited
matchMinSourceWidth bool
If true, the popup will set a min-width to the width of source.
getter/setter pair
offsetX int
How much to transform the x-axis position by.
getter/setter pair
offsetY int
How much to transform the y-axis position by.
getter/setter pair
preferredPositions Iterable<RelativePosition>
What positions should be tried when enforceSpaceConstraints is enabled.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source PopupSource?
The source of the popup, or where the popup should be seen originating from.
getter/setter pair
trackLayoutChanges bool
Whether to track the source for changes.
getter/setter pair

Methods

deliverChanges() bool
If hasObservers, synchronously emits changes that have been queued.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyChange([ChangeRecord? change]) → void
Schedules change to be delivered.
inherited
notifyPropertyChange<T>(Symbol field, T oldValue, T newValue) → T
Notify that the field name of this object has been changed.
inherited
observed() → void
May override to be notified when changes is first observed.
inherited
toString() String
A string representation of this object.
override
unobserved() → void
May override to be notified when changes is no longer observed.
inherited

Operators

operator ==(Object o) bool
The equality operator.
override