decode static method

NapaWidget? decode(
  1. dynamic data
)
override

Deserialize a json compatible object into a NapaWidget or null.

Implementation

static NapaWidget? decode(dynamic data) {
  if (data == null) {
    return null;
  }

  int flex = data['flex'];

  return NapaExpanded(
    flex: flex,
    child: NapaWidget.decode(data['child']) ?? NapaContainer(),
  );
}