MovaPatch class sealed

A pending mutation to apply to a component tree via applyPatches.

Patches are data, not actions — applyPatches is the only place that interprets them, keeping tree mutation a pure, testable function.

待应用到组件树的一次变更,通过 applyPatches 生效。

补丁只是数据而非动作——只有 applyPatches 会解释它们,从而让树的变更 保持为一个纯函数、便于测试。

Implementers

Constructors

MovaPatch.add(MovaSlot slot, MovaComponent component, {int order})
Appends a brand-new top-level component to the tree, tagged with slot and sorted by order within that slot.
const
factory
MovaPatch.insertAfter(String path, MovaComponent component)
Inserts component as a new sibling immediately after the node at path, at the same nesting level as that anchor.
const
factory
MovaPatch.remove(String path)
Removes the component found at path.
const
factory
MovaPatch.replace(String path, MovaComponent component)
Replaces the component found at path with component.
const
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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