toDocument method

  1. @override
Map<String, Object?> toDocument()
override

Implementation

@override
Map<String, Object?> toDocument() {
  final List<Map<String?, dynamic>>? workflowTaskListMap =
      workflowTask != null
          ? workflowTask!.map((item) => item.toDocument()).toList()
          : null;

  Map<String, Object?> theDocument = HashMap();
  if (name != null) {
    theDocument["name"] = name;
  } else {
    theDocument["name"] = null;
  }
  if (workflowTask != null) {
    theDocument["workflowTask"] = workflowTaskListMap;
  } else {
    theDocument["workflowTask"] = null;
  }
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  return theDocument;
}