form pro - sin imagenes
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:professional_repository/professional_repository.dart';
|
||||
|
||||
class ProfessionalEntity extends Equatable {
|
||||
final String id;
|
||||
final String identification;
|
||||
final String address;
|
||||
final String profession;
|
||||
final String rate;
|
||||
final String location;
|
||||
final String identificationPicture;
|
||||
final String certificatePicture;
|
||||
final String latitude;
|
||||
final String longitude;
|
||||
final List<String> specializations;
|
||||
final List<String> specializationsPictures;
|
||||
final Schedules schedules;
|
||||
final PaymentMethodEntity paymentMethods;
|
||||
|
||||
const ProfessionalEntity({
|
||||
required this.id,
|
||||
required this.identification,
|
||||
required this.address,
|
||||
required this.profession,
|
||||
required this.rate,
|
||||
required this.location,
|
||||
required this.identificationPicture,
|
||||
required this.certificatePicture,
|
||||
required this.latitude,
|
||||
required this.longitude,
|
||||
required this.specializations,
|
||||
required this.specializationsPictures,
|
||||
required this.schedules,
|
||||
required this.paymentMethods,
|
||||
});
|
||||
|
||||
static ProfessionalEntity fromDocument(Map<String, dynamic> doc) {
|
||||
return ProfessionalEntity(
|
||||
id: doc['id'] as String,
|
||||
identification: doc['identification'] as String,
|
||||
address: doc['address'] as String,
|
||||
profession: doc['profession'] as String,
|
||||
rate: doc['rate'] as String,
|
||||
location: doc['location'] as String,
|
||||
identificationPicture: doc['identification_picture'] as String,
|
||||
certificatePicture: doc['certificate_picture'] as String,
|
||||
latitude: doc['latitude'] as String,
|
||||
longitude: doc['longitude'] as String,
|
||||
specializations: List<String>.from(doc['specializations']),
|
||||
specializationsPictures:
|
||||
List<String>.from(doc['specializations_pictures']),
|
||||
schedules: Schedules.fromDocument(doc['schedules']),
|
||||
paymentMethods: PaymentMethodEntity.fromDocument(doc['payment_methods']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'identification': identification,
|
||||
'address': address,
|
||||
'profession': profession,
|
||||
'rate': rate,
|
||||
'location': location,
|
||||
'identification_picture': identificationPicture,
|
||||
'certificate_picture': certificatePicture,
|
||||
'latitude': latitude,
|
||||
'longitude': longitude,
|
||||
'specializations': specializations,
|
||||
'specializations_pictures': specializationsPictures,
|
||||
'schedules': schedules.toJson(),
|
||||
'payment_methods': paymentMethods.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
identification,
|
||||
address,
|
||||
profession,
|
||||
rate,
|
||||
location,
|
||||
identificationPicture,
|
||||
certificatePicture,
|
||||
latitude,
|
||||
longitude,
|
||||
specializations,
|
||||
specializationsPictures,
|
||||
schedules,
|
||||
paymentMethods
|
||||
];
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '''ProfessionalEntity{ {
|
||||
id: $id,
|
||||
identification: $identification,
|
||||
address: $address,
|
||||
profession: $profession,
|
||||
rate: $rate,
|
||||
location: $location,
|
||||
identificationPicture: $identificationPicture,
|
||||
certificatePicture: $certificatePicture,
|
||||
latitude: $latitude,
|
||||
longitude: $longitude,
|
||||
specializations: $specializations,
|
||||
specializationsPictures: $specializationsPictures,
|
||||
schedule: $schedules,
|
||||
paymentMethods: $paymentMethods
|
||||
}''';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user