FragmentMorphic class final

A grouping node that produces no DOM element.

FragmentMorphic holds a list of children that are inserted directly as siblings into the parent DOM node. It is the Morphic representation of Fragment — a way to group multiple nodes without introducing a wrapper element in the HTML output.

Example

// Fragment in render() — no extra div wrapper in the DOM
Fragment()([
  Span()(['First']),
  Span()(['Second']),
])

Diffing

FragmentMorphic is preserved in the resolved tree so that _patchChildren can diff it correctly against a previous fragment at the same position, updating only the children that changed.

Inheritance

Constructors

FragmentMorphic({required List<Morphic> children, Object? key})
const

Properties

children List<Morphic>
final
hashCode int
The hash code for this object.
no setteroverride
key Object?
finalinherited
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.
override