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.
		
		
		
		
		
			
		
			
				
					
					
						
							34 lines
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							34 lines
						
					
					
						
							1.1 KiB
						
					
					
				| import 'package:hadi_hoda_flutter/features/question/data/model/answer_model.dart'; | |
| import 'package:hadi_hoda_flutter/features/question/data/model/file_model.dart'; | |
| import 'package:hadi_hoda_flutter/features/question/domain/entity/answer_entity.dart'; | |
| import 'package:hadi_hoda_flutter/features/question/domain/entity/question_entity.dart'; | |
| 
 | |
| class QuestionModel extends QuestionEntity { | |
|   QuestionModel({ | |
|     super.id, | |
|     super.title, | |
|     super.audioId, | |
|     super.audioInfo, | |
|     super.order, | |
|     super.correctAnswer, | |
|     super.isActive, | |
|     super.answers, | |
|   }); | |
| 
 | |
|   factory QuestionModel.fromJson(Map<String, dynamic> json) { | |
|     return QuestionModel( | |
|       id: json['id'], | |
|       title: json['title'], | |
|       audioId: json['audio_id'], | |
|       audioInfo: json['audio_info'] == null | |
|           ? null | |
|           : FileModel.fromJson(json['audio_info']), | |
|       order: json['order'], | |
|       correctAnswer: json['correct_answer'], | |
|       isActive: json['is_active'], | |
|       answers: json['answers'] | |
|           ?.map<AnswerEntity>((e) => AnswerModel.fromJson(e)) | |
|           .toList(), | |
|     ); | |
|   } | |
| }
 |