fromJson static method

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

Implementation

static CubitAction fromJson(Map<String, dynamic> json) {
  if (json['type'] == 'emit_new_state') {
    return EmitNewStateAction.fromJson(json);
  }
  if (json['type'] == 'run_cubit_workflow') {
    return RunCubitWorkflowAction.fromJson(json);
  }
  throw Exception('Unknown action type');
}