clean up
This commit is contained in:
36
lib/domain/entities/customer.dart
Normal file
36
lib/domain/entities/customer.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
class Customer {
|
||||
String id;
|
||||
String name;
|
||||
String phoneNumber;
|
||||
String status;
|
||||
|
||||
Customer({
|
||||
this.id,
|
||||
this.name,
|
||||
this.status,
|
||||
this.phoneNumber,
|
||||
});
|
||||
|
||||
factory Customer.fromMap(Map<String, dynamic> map, String docID) {
|
||||
return Customer(
|
||||
id: docID,
|
||||
name: map['user_name'],
|
||||
phoneNumber: map['phone_number'],
|
||||
status: map['status'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'user_name': name,
|
||||
'phone_number': phoneNumber,
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Customer{name: $name, phoneNumber: $phoneNumber,statis:$status}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user