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.
44 lines
1.1 KiB
44 lines
1.1 KiB
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: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)
|
|
bool? isActive;
|
|
@HiveField(7)
|
|
List<AnswerEntity>? answers;
|
|
@HiveField(8)
|
|
String? audio;
|
|
|
|
QuestionEntity({
|
|
this.id,
|
|
this.title,
|
|
this.audioId,
|
|
this.audioInfo,
|
|
this.order,
|
|
this.correctAnswer,
|
|
this.isActive,
|
|
this.answers,
|
|
}){
|
|
audio =
|
|
'${StoragePath.documentDir.path}/${LocalStorage.readData(key: MyConstants.selectLanguage)}/audio/${audioInfo?.filename}';
|
|
}
|
|
}
|