GlassMenuController class

Drives a GlassMenu imperatively, bypassing the trigger tap.

Pass it to GlassMenu.controller. Unlike tapping the trigger (which toggles and is gated on the morph progress), open and close command the menu's morph directly, so a close that lands mid-open reliably dismisses the menu instead of re-opening it. Intended for cases where something other than the menu's own trigger decides when it appears — e.g. a central gesture arena.

One controller drives one mounted GlassMenu at a time.

Constructors

GlassMenuController()

Properties

hashCode int
The hash code for this object.
no setterinherited
isOpen bool
Whether the menu's overlay is currently shown (open, or animating closed).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes the menu with the rubber-band morph. Deterministic for any timing: unlike a trigger tap, it never re-opens a still-expanding menu.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() → void
Opens the menu, morphing from the trigger's current position. Safe to call while a close is still animating — the spring reverses toward open.
setFollowOffset(Offset offset) → void
Nudges the open menu to track a moving anchor: offset (screen px) is added to the menu's captured trigger position every frame until reset. A no-op while closed; cleared on the next open. Used by external gesture owners that move the anchor AFTER opening — e.g. a canvas tile trailing under a rubberband, where the menu should stay glued to the tile.
toString() String
A string representation of this object.
inherited

Operators

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