You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/models/gas_refill_comments_model.dart

78 lines
1.7 KiB
Dart

class GasRefillComment {
GasRefillComment({
this.id,
this.gasRefillId,
this.createdOn,
this.createdBy,
this.comment,
});
GasRefillComment.fromJson(dynamic json) {
id = json['id'];
gasRefillId = json['gasRefillId'];
createdOn = json['createdOn'];
createdBy = json['createdBy'] != null ? CreatedBy.fromJson(json['createdBy']) : null;
comment = json['comment'];
}
num? id;
num? gasRefillId;
String? createdOn;
CreatedBy? createdBy;
String? comment;
GasRefillComment copyWith({
num? id,
num? callRequestId,
String? createdOn,
CreatedBy? createdBy,
String? comment,
}) =>
GasRefillComment(
id: id ?? this.id,
gasRefillId: callRequestId ?? gasRefillId,
createdOn: createdOn ?? this.createdOn,
createdBy: createdBy ?? this.createdBy,
comment: comment ?? this.comment,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['gasRefillId'] = gasRefillId;
map['createdOn'] = createdOn;
if (createdBy != null) {
map['createdBy'] = createdBy!.toJson();
}
map['comment'] = comment;
return map;
}
}
class CreatedBy {
CreatedBy({
this.userId,
this.userName,
});
CreatedBy.fromJson(dynamic json) {
userId = json['userId'];
userName = json['userName'];
}
String? userId;
String? userName;
CreatedBy copyWith({String? userId, String? userName}) => CreatedBy(
userId: userId ?? this.userId,
userName: userName ?? this.userName,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['userId'] = userId;
map['userName'] = userName;
return map;
}
}