48 lines
1.0 KiB
Dart
48 lines
1.0 KiB
Dart
class GetReviewModel {
|
|
final int id;
|
|
final int userId;
|
|
final int serviceId;
|
|
final String review;
|
|
final String createdDate;
|
|
final String userName;
|
|
|
|
final String? profilePic1;
|
|
|
|
GetReviewModel({
|
|
required this.id,
|
|
required this.userId,
|
|
required this.serviceId,
|
|
required this.review,
|
|
required this.createdDate,
|
|
required this.userName,
|
|
|
|
this.profilePic1,
|
|
});
|
|
|
|
factory GetReviewModel.fromJson(Map<String, dynamic> json) {
|
|
return GetReviewModel(
|
|
id: json['id'] ?? 0,
|
|
userId: json['user_id'] ?? 0,
|
|
serviceId: json['service_id'] ?? 0,
|
|
review: json['review'] ?? '',
|
|
createdDate: json['created_date'] ?? '',
|
|
userName: json['user_name'] ?? '',
|
|
|
|
profilePic1: json['profile_pic1'],
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'user_id': userId,
|
|
'service_id': serviceId,
|
|
'review': review,
|
|
'created_date': createdDate,
|
|
'user_name': userName,
|
|
|
|
'profile_pic1': profilePic1,
|
|
};
|
|
}
|
|
}
|