Aidra Connect
10.0.2+16
Aidra Connect Mobile Application
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
class CurrencyEntity id
Definition
collection_entity.dart:522
pdfPath
final String pdfPath
Definition
elearning_v2_state.dart:38
iconColor
final Color iconColor
Definition
emission_breakdown_list.dart:165
title
final String title
Definition
transaction_summary_view.dart:35
progress
final double progress
Definition
update_course_progress_usecase.dart:21
lib
features
elearning_v2
data
models
course_model.dart
Generated by
1.16.1