Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
course_entity.dart
Go to the documentation of this file.
1import 'package:equatable/equatable.dart';
2
3class CourseEntity extends Equatable {
4 final int? id;
5 final String? title;
6 final String? description;
7 final String? imageUrl;
8 final String? pdfPath;
9 final String? qcmPath;
10 final int? durationMinutes;
11 final double? progress;
12 final String? iconColor;
13 final DateTime? createdAt;
14
16 this.id,
17 this.title,
18 this.description,
19 this.imageUrl,
20 this.pdfPath,
21 this.qcmPath,
22 this.durationMinutes,
23 this.progress = 0.0,
24 this.iconColor,
25 this.createdAt,
26 });
27
28 @override
29 List<Object?> get props => [
30 id,
40 ];
41
43 int? id,
44 String? title,
45 String? description,
46 String? imageUrl,
47 String? pdfPath,
48 String? qcmPath,
49 int? durationMinutes,
50 double? progress,
51 String? iconColor,
52 DateTime? createdAt,
53 }) {
54 return CourseEntity(
55 id: id ?? this.id,
56 title: title ?? this.title,
57 description: description ?? this.description,
58 imageUrl: imageUrl ?? this.imageUrl,
59 pdfPath: pdfPath ?? this.pdfPath,
60 qcmPath: qcmPath ?? this.qcmPath,
61 durationMinutes: durationMinutes ?? this.durationMinutes,
62 progress: progress ?? this.progress,
63 iconColor: iconColor ?? this.iconColor,
64 createdAt: createdAt ?? this.createdAt,
65 );
66 }
67
68 factory CourseEntity.fromJson(Map<String, dynamic> json) {
69 return CourseEntity(
70 id: json['id'],
71 title: json['title'],
72 description: json['description'],
73 imageUrl: json['imageUrl'],
74 pdfPath: json['pdfPath'],
75 qcmPath: json['qcmPath'],
76 durationMinutes: json['durationMinutes'],
77 progress: json['progress']?.toDouble() ?? 0.0,
78 iconColor: json['iconColor'],
79 createdAt: json['createdAt'] != null
80 ? DateTime.parse(json['createdAt'])
81 : null,
82 );
83 }
84}
final int durationMinutes
final double progress
final String iconColor
final String imageUrl
final String qcmPath
override List< Object?> get CourseEntity copyWith({ int? id, String? title, String? description, String? imageUrl, String? pdfPath, String? qcmPath, int? durationMinutes, double? progress, String? iconColor, DateTime? createdAt, })
final DateTime createdAt
const CourseEntity({ this.id, this.title, this.description, this.imageUrl, this.pdfPath, this.qcmPath, this.durationMinutes, this.progress=0.0, this.iconColor, this.createdAt, })
final String title
final String pdfPath
final String description
final int id
class CurrencyEntity id
final String pdfPath
final Color iconColor
final String title
final double progress
abstract class UseCase< Type, Params > props