WorkflowCreate.fromJson constructor

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

Implementation

factory WorkflowCreate.fromJson(Map<String, Object?> json) {
  return WorkflowCreate(
    description: json[r'description'] as String?,
    name: json[r'name'] as String? ?? '',
    startPointLayout: json[r'startPointLayout'] != null
        ? WorkflowLayout.fromJson(
            json[r'startPointLayout']! as Map<String, Object?>)
        : null,
    statuses: (json[r'statuses'] as List<Object?>?)
            ?.map((i) => StatusLayoutUpdate.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    transitions: (json[r'transitions'] as List<Object?>?)
            ?.map((i) => TransitionUpdateDTO.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
  );
}