fromMap static method

WorkflowEntity? fromMap(
  1. Object? o, {
  2. Map<String, String>? newDocumentIds,
})

Implementation

static WorkflowEntity? fromMap(Object? o,
    {Map<String, String>? newDocumentIds}) {
  if (o == null) return null;
  var map = o as Map<String, dynamic>;

  var workflowTaskFromMap = map['workflowTask'];
  List<WorkflowTaskEntity> workflowTaskList;
  if (workflowTaskFromMap != null) {
    workflowTaskList = (map['workflowTask'] as List<dynamic>)
        .map((dynamic item) => WorkflowTaskEntity.fromMap(item as Map,
            newDocumentIds: newDocumentIds)!)
        .toList();
  } else {
    workflowTaskList = [];
  }

  return WorkflowEntity(
    name: map['name'],
    workflowTask: workflowTaskList,
    appId: map['appId'],
  );
}