Teat - Services - fixed models with provider_id
This commit is contained in:
@@ -7,6 +7,7 @@ class EntertainmentServiceModel extends Equatable {
|
||||
final bool constrained; // Vincolato?
|
||||
final DateTime constrainExpiration;
|
||||
final String? serviceId;
|
||||
final String? providerId;
|
||||
|
||||
const EntertainmentServiceModel({
|
||||
this.id,
|
||||
@@ -15,6 +16,7 @@ class EntertainmentServiceModel extends Equatable {
|
||||
required this.constrained,
|
||||
required this.constrainExpiration,
|
||||
this.serviceId,
|
||||
this.providerId,
|
||||
});
|
||||
|
||||
EntertainmentServiceModel copyWith({
|
||||
@@ -24,6 +26,7 @@ class EntertainmentServiceModel extends Equatable {
|
||||
bool? constrained,
|
||||
DateTime? constrainExpiration,
|
||||
String? serviceId,
|
||||
String? providerId,
|
||||
}) {
|
||||
return EntertainmentServiceModel(
|
||||
id: id ?? this.id,
|
||||
@@ -32,6 +35,7 @@ class EntertainmentServiceModel extends Equatable {
|
||||
constrained: constrained ?? this.constrained,
|
||||
constrainExpiration: constrainExpiration ?? this.constrainExpiration,
|
||||
serviceId: serviceId ?? this.serviceId,
|
||||
providerId: providerId ?? this.providerId,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,6 +47,7 @@ class EntertainmentServiceModel extends Equatable {
|
||||
constrained,
|
||||
constrainExpiration,
|
||||
serviceId,
|
||||
providerId,
|
||||
];
|
||||
|
||||
factory EntertainmentServiceModel.fromMap(Map<String, dynamic> map) {
|
||||
@@ -55,6 +60,7 @@ class EntertainmentServiceModel extends Equatable {
|
||||
constrained: map['constrained'] ?? false,
|
||||
constrainExpiration: DateTime.parse(map['constrain_expiration']),
|
||||
serviceId: map['service_id'],
|
||||
providerId: map['provider_id'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -65,6 +71,7 @@ class EntertainmentServiceModel extends Equatable {
|
||||
'constrained': constrained,
|
||||
'constrain_expiration': constrainExpiration.toIso8601String(),
|
||||
'service_id': serviceId,
|
||||
'provider_id': providerId,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user