decode static method

NapaContainer? decode(
  1. dynamic data
)
override

Deserialize a json compatible object into a NapaWidget or null.

Implementation

static NapaContainer? decode(dynamic data) {
  AlignmentGeometry? alignment = decodeAlignmentGeometry(data['alignment']);
  EdgeInsetsGeometry? padding;
  Color? color = decodeColor(data['color']);
  Decoration? decoration = decodeDecoration(data['decoration']);
  Decoration? foregroundDecoration = decodeDecoration(
    data['foregroundDecoration'],
  );
  double? width = data['width'];
  double? height = data['height'];
  BoxConstraints? constraints;
  EdgeInsetsGeometry? margin;
  NapaMatrix4Compose? transform = NapaMatrix4Compose.decode(
    data['transform'],
  );
  AlignmentGeometry? transformAlignment = decodeAlignmentGeometry(
    data['transformAlignment'],
  );
  Clip clipBehavior = decodeClip(data['clipBehavior']);
  NapaWidget? child = NapaWidget.decode(data['child']);

  return NapaContainer(
    alignment: alignment,
    padding: padding,
    color: color,
    decoration: decoration,
    foregroundDecoration: foregroundDecoration,
    width: width,
    height: height,
    constraints: constraints,
    margin: margin,
    transform: transform,
    transformAlignment: transformAlignment,
    clipBehavior: clipBehavior,
    child: child,
  );
}