decode static method

NapaPhysicalModel? decode(
  1. dynamic data
)
override

Deserialize a json compatible object into a NapaWidget or null.

Implementation

static NapaPhysicalModel? decode(dynamic data) {
  if (data == null) return null;
  return NapaPhysicalModel(
    shape: decodeBoxShape(data['shape']),
    clipBehavior: decodeClip(data['clipBehavior']),
    elevation: (data['elevation'] as num? ?? 0).toDouble(),
    color: decodeColor(data['color'])!,
    shadowColor: decodeColor(data['shadowColor']) ?? const Color(0xFF000000),
    child: NapaWidget.decode(data['child']),
  );
}