LaminatePlatePropertiesInput.fromJson constructor

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

Implementation

factory LaminatePlatePropertiesInput.fromJson(Map<String, dynamic> json) {
  return LaminatePlatePropertiesInput(
    analysisType: AnalysisType.values.firstWhere(
          (e) =>
      e.toString() ==
          'AnalysisType.' + (json['analysis_type'] ?? "elastic"),
      orElse: () => AnalysisType.elastic, // Default value if not found
    ),
    E1: (json['E1'] ?? 0).toDouble(),
    E2: (json['E2'] ?? 0).toDouble(),
    G12: (json['G12'] ?? 0).toDouble(),
    nu12: (json['nu12'] ?? 0).toDouble(),
    layupSequence: (json['layup_sequence'] ?? "").toString(),
    layerThickness: (json['layer_thickness'] ?? 0).toDouble(),
    alpha11: (json['alpha11'] ?? 0).toDouble(),
    alpha22: (json['alpha22'] ?? 0).toDouble(),
    alpha12: (json['alpha12'] ?? 0).toDouble(),
  );
}