You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							29 lines
						
					
					
						
							984 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							29 lines
						
					
					
						
							984 B
						
					
					
				| import 'package:hadi_hoda_flutter/features/level/domain/entity/level_entity.dart'; | |
| import 'package:hadi_hoda_flutter/features/question/data/model/hadith_model.dart'; | |
| import 'package:hadi_hoda_flutter/features/question/data/model/question_model.dart'; | |
| import 'package:hadi_hoda_flutter/features/question/domain/entity/hadith_entity.dart'; | |
| import 'package:hadi_hoda_flutter/features/question/domain/entity/question_entity.dart'; | |
| 
 | |
| class LevelModel extends LevelEntity { | |
|   LevelModel({ | |
|     super.id, | |
|     super.order, | |
|     super.title, | |
|     super.questions, | |
|     super.hadith, | |
|   }); | |
| 
 | |
|   factory LevelModel.fromJson(Map<String, dynamic> json) { | |
|     return LevelModel( | |
|       id: json['id'], | |
|       order: json['order'], | |
|       title: json['title'], | |
|       questions: json['questions'] | |
|           ?.map<QuestionEntity>((e) => QuestionModel.fromJson(e)) | |
|           .toList(), | |
|       hadith: json['hadiths'] | |
|           ?.map<HadithEntity>((e) => HadithModel.fromJson(e)) | |
|           .toList(), | |
|     ); | |
|   } | |
| }
 |