MorphPiece class
A piece of a liquid group: explicit geometry (no tree measurement, like the rest of the morph system) plus live content on top of the skin. rect and radius are plain frame data: an animating consumer derives them from its own spring value.
Morphing out of a piece takes no ceremony: MorphPiece.morphable wraps the content in a correctly configured MorphTag (piece id, shape from its radius, skin color, tag bump disabled - the skin plays the landing), and the group finds the flight in the MorphScope by id on its own. The consumer just calls showMorph*(from: id) from any context.
Constructors
- MorphPiece({required Object id, required Rect rect, double radius = 20, bool solid = true, double bumpScale = 0.6, double bumpRecoil = 140, MorphPieceChannel? channel, Widget? child})
-
Creates a plain piece: mass and content, no morph identity.
const
- MorphPiece.morphable({required Object id, required Rect rect, double radius = 20, bool solid = true, double bumpScale = 0.6, double bumpRecoil = 140, MorphPieceChannel? channel, required Widget child})
-
A morph-source piece: the group installs a MorphTag around the
content itself and plays the flight neck whenever a flight is
launched with this piece's id.
const
Properties
- bumpRecoil → double
-
Landing kick-off distance in px (MorphTag.bumpRecoil semantics).
final
- bumpScale → double
-
Landing squash intensity of the mass (MorphTag.bumpScale
semantics).
final
- channel → MorphPieceChannel?
-
App-driven per-frame geometry over rect: when set, the skin
subscribes and mirrors the channel's delta onto the mass and the
content with no widget rebuild. See MorphPieceChannel.
final
- child → Widget?
-
Live content laid out over the piece's rect.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → Object
-
Identity within the group; also the flight id for morphable pieces.
final
- morphable → bool
-
Whether the group installs a MorphTag around child.
final
- radius → double
-
Corner radius of the mass; clamped to half the shorter side, so
radius >= min(w, h) / 2 yields a stadium.
final
- rect → Rect
-
The mass geometry in the group's local coordinates.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- solid → bool
-
false - the piece contributes no mass to the skin (and its bridges
are skipped), but the content stays mounted in place.
final
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