Initial commit of Flutter project
This commit is contained in:
@@ -1,6 +1,27 @@
|
||||
class ServiceBoy {
|
||||
final String id;
|
||||
final String name;
|
||||
final String phone;
|
||||
|
||||
ServiceBoy({required this.name, required this.phone});
|
||||
ServiceBoy({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.phone,
|
||||
});
|
||||
|
||||
factory ServiceBoy.fromJson(Map<String, dynamic> json) {
|
||||
return ServiceBoy(
|
||||
id: json['_id'],
|
||||
name: json['name'],
|
||||
phone: json['phone'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'_id': id,
|
||||
'name': name,
|
||||
'phone': phone,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user