MorphPiece.morphable constructor

const MorphPiece.morphable({
  1. required Object id,
  2. required Rect rect,
  3. double radius = 20,
  4. bool solid = true,
  5. double bumpScale = 0.6,
  6. double bumpRecoil = 140,
  7. MorphPieceChannel? channel,
  8. 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.

Implementation

// The child is required BY TYPE: the MorphTag that gives the piece
// its flight identity wraps the child, so a childless piece would
// register no tag and showMorph*(from: id) could never find the
// source.
const MorphPiece.morphable({
  required this.id,
  required this.rect,
  this.radius = 20,
  this.solid = true,
  this.bumpScale = 0.6,
  this.bumpRecoil = 140,
  this.channel,
  required Widget this.child,
}) : morphable = true;