ContentStateSettings.fromJson constructor

ContentStateSettings.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory ContentStateSettings.fromJson(Map<String, Object?> json) {
  return ContentStateSettings(
    contentStatesAllowed: json[r'contentStatesAllowed'] as bool? ?? false,
    customContentStatesAllowed:
        json[r'customContentStatesAllowed'] as bool? ?? false,
    spaceContentStatesAllowed:
        json[r'spaceContentStatesAllowed'] as bool? ?? false,
    spaceContentStates: (json[r'spaceContentStates'] as List<Object?>?)
            ?.map((i) =>
                ContentState.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
  );
}