MorphSkin constructor

const MorphSkin({
  1. Key? key,
  2. required List<MorphPiece> pieces,
  3. List<MorphLink> links = const <MorphLink>[],
  4. List<MorphMass> extraMasses = const <MorphMass>[],
  5. MorphSkinStyle? style,
  6. double? blend,
  7. double? cell,
  8. int? smoothPasses,
  9. int? evalBudget = defaultEvalBudget,
  10. required Color color,
  11. Gradient? gradient,
  12. double elevation = 0,
  13. Color? shadowColor,
  14. Clip clipBehavior = .none,
})

Creates a skin over pieces, optionally bridged by links.

Implementation

const MorphSkin({
  super.key,
  required this.pieces,
  this.links = const <MorphLink>[],
  this.extraMasses = const <MorphMass>[],
  this.style,
  this.blend,
  this.cell,
  this.smoothPasses,
  this.evalBudget = defaultEvalBudget,
  required this.color,
  this.gradient,
  this.elevation = 0,
  this.shadowColor,
  this.clipBehavior = .none,
}) : assert(
       blend == null || blend >= 0,
       'blend (the smin k) is a distance in px and cannot be negative.',
     ),
     assert(
       cell == null || cell > 0,
       'cell is the sampling grid step in px and must be positive.',
     ),
     assert(
       smoothPasses == null || smoothPasses >= 0,
       'smoothPasses cannot be negative.',
     ),
     assert(
       evalBudget == null || evalBudget > 0,
       'evalBudget is a positive per-cluster evaluation cap; '
       'pass null to disable it.',
     ),
     assert(elevation >= 0, 'elevation cannot be negative.');