fromJson static method

WorkflowEntity fromJson(
  1. Map<String, dynamic> json,
  2. ActionMapper actionMapper
)

Implementation

static WorkflowEntity fromJson(
    Map<String, dynamic> json, ActionMapper actionMapper) {
  return WorkflowEntity(
    id: json['id'],
    name: json['name'],
    cubitID: json['cubit_id'],
    trigger:
        json['trigger'] != null ? Trigger.fromString(json['trigger']) : null,
    actions: json['actions'] != null
        ? (json['actions'] as List<dynamic>)
            .map(
              (e) => actionMapper.fromJson(
                  e as Map<String, dynamic>, actionMapper),
            )
            .toList()
        : [],
  );
}