import 'package:hadi_hoda_flutter/core/constants/my_constants.dart'; import 'package:hadi_hoda_flutter/core/utils/local_storage.dart'; import 'package:hadi_hoda_flutter/core/utils/storage_path.dart'; import 'package:hadi_hoda_flutter/features/question/domain/entity/answer_entity.dart'; import 'package:hadi_hoda_flutter/features/question/domain/entity/file_entity.dart'; import 'package:hadi_hoda_flutter/features/question/domain/entity/hadith_entity.dart'; import 'package:hive/hive.dart'; part 'question_entity.g.dart'; @HiveType(typeId: 2) class QuestionEntity extends HiveObject { @HiveField(0) int? id; @HiveField(1) String? title; @HiveField(2) String? audioId; @HiveField(3) FileEntity? audioInfo; @HiveField(4) int? order; @HiveField(5) int? correctAnswer; @HiveField(6) String? correctAnswerText; @HiveField(7) String? correctAnswerAudioId; @HiveField(8) FileEntity? correctAnswerAudioInfo; @HiveField(9) List? hadiths; @HiveField(10) bool? isActive; @HiveField(11) List? answers; @HiveField(12) String? audio; @HiveField(13) String? correctAudio; @HiveField(14) String? imageId; @HiveField(15) FileEntity? imageInfo; @HiveField(16) String? image; QuestionEntity({ this.id, this.title, this.audioId, this.audioInfo, this.order, this.correctAnswer, this.isActive, this.answers, this.hadiths, this.correctAnswerAudioId, this.correctAnswerText, this.correctAnswerAudioInfo, this.imageId, this.imageInfo, }){ audio = '${StoragePath.documentDir.path}/${LocalStorage.readData(key: MyConstants.selectLanguage)}/question_audio/${audioInfo?.filename}'; correctAudio = '${StoragePath.documentDir.path}/${LocalStorage.readData(key: MyConstants.selectLanguage)}/correct_answer_audio/${correctAnswerAudioInfo?.filename}'; image = '${StoragePath.documentDir.path}/question_image/${imageInfo?.filename}'; } }