process method

Future<Map<String, dynamic>> process()

Internal method used by dash_agent to convert the shared DataSource to json format that can be sent on the web

Note: Ideally, this method is not supposed to be overriden by the child objects and should not be altered. It is called automatically by the framework.

Implementation

Future<Map<String, dynamic>> process() async {
  final Map<String, dynamic> processedJson = {'id': hashCode.toString()};

  processedJson['version'] = minCliVersion;
  processedJson['project_objects'] = [];
  for (final projectObject in projectObjects) {
    processedJson['project_objects'].add(await projectObject.process());
  }
  processedJson['file_objects'] = [];
  for (final fileObject in fileObjects) {
    processedJson['file_objects'].add(await fileObject.process());
  }
  processedJson['web_objects'] = [];
  for (final webObject in webObjects) {
    processedJson['web_objects'].add(await webObject.process());
  }

  return processedJson;
}