PredictSpecialty.fromJson constructor

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

Implementation

factory PredictSpecialty.fromJson(Map<String, dynamic> json) {
  var subCategoriesJson = json['subCategories'] as List;
  List<SubCategory> subCategoryList = subCategoriesJson
      .map((subCategoryJson) => SubCategory.fromJson(subCategoryJson))
      .toList();

  return PredictSpecialty(
    specialtyId: json['specialty_id'] as int,
    subCategories: subCategoryList,
  );
}