Aidra Driver
1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
course_model.dart
Go to the documentation of this file.
1
import
'../../domain/entities/course_entity.dart';
2
3
class
CourseModel
extends
CourseEntity
{
4
const
CourseModel
({
5
super.id,
6
super.title,
7
super.description,
8
super.imageUrl,
9
super.pdfPath,
10
super.qcmPath,
11
super.durationMinutes,
12
super.progress,
13
super.iconColor,
14
super.createdAt,
15
});
16
17
factory
CourseModel
.fromJson(Map<String, dynamic> json) {
18
return
CourseModel
(
19
id
: json[
'id'
],
20
title
: json[
'title'
],
21
description: json[
'description'
],
22
imageUrl: json[
'imageUrl'
],
23
pdfPath
: json[
'pdfPath'
],
24
qcmPath: json[
'qcmPath'
],
25
durationMinutes: json[
'durationMinutes'
],
26
progress
: 0.0,
// Default to 0.0 as progress comes from SharedPreferences
27
iconColor: json[
'iconColor'
],
28
createdAt:
29
json[
'createdAt'
] != null ? DateTime.parse(json[
'createdAt'
]) : null,
30
);
31
}
32
33
Map<String, dynamic>
toJson
() {
34
return
{
35
'id'
:
id
,
36
'title'
:
title
,
37
'description'
: description,
38
'imageUrl'
: imageUrl,
39
'pdfPath'
:
pdfPath
,
40
'qcmPath'
: qcmPath,
41
'durationMinutes'
: durationMinutes,
42
'progress'
:
progress
,
43
'iconColor'
: iconColor,
44
'createdAt'
: createdAt?.toIso8601String(),
45
};
46
}
47
}
CourseEntity
Definition
course_model.dart:3
CourseEntity::toJson
Map< String, dynamic > toJson()
Definition
course_model.dart:33
CourseEntity::CourseModel
const CourseModel({ super.id, super.title, super.description, super.imageUrl, super.pdfPath, super.qcmPath, super.durationMinutes, super.progress, super.iconColor, super.createdAt, })
id
final int id
Definition
collection_voucher_document_model.dart:42
pdfPath
final String pdfPath
Definition
elearning_v2_state.dart:38
title
final String title
Definition
show_documents_option.dart:22
progress
final double progress
Definition
update_course_progress_usecase.dart:21
lib
features
e-learning
data
models
course_model.dart
Generated by
1.16.1