MermaidViewController class
Controls the viewport of one attached MermaidView.
A controller can be attached to one view at a time. Commands return false
when the controller is detached, disposed, the view has no usable layout,
or focusNode cannot resolve the requested node. Each command waits until
updated diagram layout has been reported, so a focus requested with a
source update uses the new scene rather than stale node bounds.
The controller is a ChangeNotifier. transformation returns a cloned snapshot of the matrix used by the view, so callers cannot mutate the view through the returned value. Dispose the controller after removing its view; disposing while attached only detaches this public command surface and the view continues to operate.
- Inheritance
-
- Object
- ChangeNotifier
- MermaidViewController
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isAttached → bool
-
Whether this controller is currently attached to a MermaidView.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transformation → Matrix4
-
A read-only snapshot of the current scene-to-viewport transformation.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Releases listeners and prevents further attachment or commands.
override
-
fitAll(
{bool animate = true}) → Future< bool> - Fits the complete diagram inside the viewport.
-
focusNode(
String id, {double? zoom, bool animate = true}) → Future< bool> -
Centres node
id, optionally changing tozoom. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited