CodePartDj.fromJson constructor

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

Implementation

factory CodePartDj.fromJson(Map<String, dynamic> json) {
  var codePartDj = _$CodePartDjFromJson(json);

  switch (codePartDj.codePartDjType) {
    case CodePartDjType.Function:
      return FunctionDj.fromJson(json);
    case CodePartDjType.FunctionCall:
      return FunctionCallDj.fromJson(json);
    case CodePartDjType.IfElse:
      return IfElseDj.fromJson(json);
    case CodePartDjType.Import:
      return ImportDj.fromJson(json);
    case CodePartDjType.Return:
      return ReturnDj.fromJson(json);
    case CodePartDjType.Class:
      return ClassDj.fromJson(json);
    case CodePartDjType.Field:
      return FieldDj.fromJson(json);
    case CodePartDjType.Enum:
      return EnumDj.fromJson(json);
    case CodePartDjType.Map:
      return MapDj.fromJson(json);
    case CodePartDjType.EmptyLine:
      return EmptyLineDj.fromJson(json);
    case CodePartDjType.VariableDeclaration:
      return VariableDeclarationDj.fromJson(json);
    case CodePartDjType.SingleLine:
      return SingleLineDj.fromJson(json);
    case CodePartDjType.Export:
      return ExportDj.fromJson(json);
    case CodePartDjType.BaseWidget:
      return BaseWidgetDj.fromJson(json);
    default:
      throw Exception(
        'CodePartDj.fromJson not handled for ${codePartDj.codePartDjType}',
      );
  }
}