fromJson static method

PassingParameter fromJson(
  1. Map<String, dynamic> json
)

Implementation

static PassingParameter fromJson(Map<String, dynamic> json) {
  assert(json['type'] != null, 'Parameter type must be defined');
  if (json['type'] == 'fromCubit') {
    return PassingComponentParameterFromCubit.fromJson(json);
  } else if (json['type'] == 'fromText') {
    return PassingComponentParameterFromText.fromJson(json);
  } else if (json['type'] == 'fromWorkflow') {
    return PassingComponentParameterFromWorkflow.fromJson(json);
  }
  throw Exception('Unknown parameter type');
}