process method

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

Internal method used by dash_agent to convert the shared Commmand to json formated cofiguration that is deployable.

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 = {};
  List<DashOutput> registerOutputs = [];
  processedJson['slug'] = slug;
  processedJson['intent'] = intent;
  processedJson['text_field_layout'] = textFieldLayout;

  processedJson['steps'] = [];
  for (final step in steps) {
    registerOutputs.addAll(step.dashOutputs);
    processedJson['steps'].add(await step.process());
  }

  processedJson['registered_inputs'] = [];
  for (final input in registerInputs) {
    processedJson['registered_inputs'].add(await input.process());
  }

  processedJson['registered_outputs'] = [];
  for (final output in registerOutputs.toSet().toList()) {
    processedJson['registered_outputs'].add(await output.process());
  }

  processedJson['version'] = minCliVersion;
  return processedJson;
}