decode static method

NapaInteractiveViewer? decode(
  1. dynamic data
)
override

Deserialize a json compatible object into a NapaWidget or null.

Implementation

static NapaInteractiveViewer? decode(dynamic data) {
  if (data == null) return null;
  return NapaInteractiveViewer(
    boundaryMargin: decodeEdgeInsets(data['boundaryMargin']),
    constrained: data['constrained'] ?? true,
    maxScale: (data['maxScale'] as num? ?? 2.5).toDouble(),
    minScale: (data['minScale'] as num? ?? 0.8).toDouble(),
    panEnabled: data['panEnabled'] ?? true,
    scaleEnabled: data['scaleEnabled'] ?? true,
    child: NapaWidget.decode(data['child']),
  );
}