fromJson static method

PageBlockListItem? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static PageBlockListItem? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return PageBlockListItem(
    label: (json['label'] as String?) ?? '',
    blocks: List<PageBlock>.from(
        ((json['blocks'] as List<dynamic>?) ?? <dynamic>[])
            .map((item) => PageBlock.fromJson(item as Map<String, dynamic>?))
            .toList()),
    hasCheckbox: (json['has_checkbox'] as bool?) ?? false,
    isChecked: (json['is_checked'] as bool?) ?? false,
    value: (json['value'] as int?) ?? 0,
    type: (json['type'] as String?) ?? '',
  );
}