servicio
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:service_repository/service_repository.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ServiceEntity extends Equatable {
|
||||
final String? id;
|
||||
final String professionalId;
|
||||
final bool professionalScored;
|
||||
final String userId;
|
||||
@@ -22,6 +23,7 @@ class ServiceEntity extends Equatable {
|
||||
final ServiceLocationPreferences location;
|
||||
|
||||
const ServiceEntity({
|
||||
this.id,
|
||||
required this.professionalId,
|
||||
required this.professionalScored,
|
||||
required this.userId,
|
||||
@@ -40,8 +42,9 @@ class ServiceEntity extends Equatable {
|
||||
required this.location,
|
||||
});
|
||||
|
||||
static ServiceEntity fromDocument(Map<String, dynamic> doc) {
|
||||
static ServiceEntity fromDocument(Map<String, dynamic> doc, String id) {
|
||||
return ServiceEntity(
|
||||
id: id,
|
||||
professionalId: doc['professional_id'] as String,
|
||||
professionalScored: doc['professional_scored'] as bool,
|
||||
userId: doc['user_id'] as String,
|
||||
@@ -68,6 +71,7 @@ class ServiceEntity extends Equatable {
|
||||
|
||||
Map<String, dynamic> toDocument() {
|
||||
return {
|
||||
'id': id,
|
||||
'professional_id': professionalId,
|
||||
'professional_scored': professionalScored,
|
||||
'user_id': userId,
|
||||
@@ -95,7 +99,8 @@ class ServiceEntity extends Equatable {
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
professionalId,
|
||||
professionalScored,
|
||||
userId,
|
||||
|
||||
Reference in New Issue
Block a user