MenuController class final

Opens and closes a single MenuAnchor.

isOpen is false while detached. open throws in every build mode until a MenuAnchor attaches; menus have no pending-open contract. close is a no-op while detached or already closed. maybeOf returns the nearest logical ancestor's controller without registering an inherited dependency.

Constructors

Starts detached; open throws until a MenuAnchor attaches.

Properties

hashCode int
The hash code for this object.
no setterinherited
isOpen bool
Whether the attached anchor currently has an open menu.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes the attached menu. Unattached or already-closed calls are no-ops.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open({Offset? position}) → void
Opens the attached menu. Throws if this controller is not attached.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

maybeOf(BuildContext context) MenuController?
The nearest enclosing MenuAnchor controller, without a dependency.