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
- MenuController()
- Starts detached; open throws until a MenuAnchor attaches.
Properties
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.