fromJson static method

ActionEntity fromJson(
  1. Map<String, dynamic> json,
  2. ActionMapper actionMapper
)

Implementation

static ActionEntity fromJson(
    Map<String, dynamic> json, ActionMapper actionMapper) {
  if (json['type'] == ActionGroups.unset) {
    return UnsetActionEntity.fromJson(json);
  }
  switch (json['group']) {
    case ActionGroups.pageViewController:
      return PageViewControllerAction.fromJson(json);
    case ActionGroups.cms:
      return CMSAction.fromJson(json);
    case ActionGroups.console:
      return ConsoleAction.fromJson(json);
    case ActionGroups.navigator:
      return NavigatorAction.fromJson(json);
    case ActionGroups.hapticFeedback:
      return HapticFeedbackAction.fromJson(json);
    case ActionGroups.variables:
      return VariablesAction.fromJson(json);
    case ActionGroups.condition:
      return ConditionalAction.fromJson(json, actionMapper);
    case ActionGroups.listViewController:
      return ListViewAction.fromJson(json);
    /*case ActionGroups.uiState:
      return UIStateAction.fromJson(json);*/
    case ActionGroups.apiRequest:
      return APIRequestAction.fromJson(json, actionMapper);
    case ActionGroups.cubit:
      return CubitAction.fromJson(json);
    case ActionGroups.parameter:
      return ParameterAction.fromJson(json);
  }
  throw Exception('ActionEntity, Unknown action type: ${json['type']}');
}