52 lines
852 B
Dart
52 lines
852 B
Dart
import 'package:aitrainer_app/model/customer.dart';
|
|
|
|
class CustomerViewModel {
|
|
Customer customer;
|
|
bool visibleDetails = false;
|
|
|
|
CustomerViewModel({this.customer});
|
|
|
|
String get name {
|
|
return this.customer.name;
|
|
}
|
|
|
|
String get firstName {
|
|
return this.customer.firstName;
|
|
}
|
|
|
|
String get sex {
|
|
return this.customer.sex == "m" ? "Man" : "Woman";
|
|
}
|
|
|
|
int get age {
|
|
return this.customer.age;
|
|
}
|
|
|
|
setName(String name) {
|
|
this.customer.name = name;
|
|
}
|
|
setFirstName(String firstName) {
|
|
this.customer.firstName = firstName;
|
|
}
|
|
|
|
setEmail(String email) {
|
|
this.customer.email = email;
|
|
}
|
|
|
|
setAge(int age) {
|
|
this.customer.age = age;
|
|
}
|
|
|
|
setSex(String sex) {
|
|
this.customer.sex = sex;
|
|
}
|
|
|
|
createNew() {
|
|
this.customer = Customer();
|
|
}
|
|
|
|
Customer getCustomer() {
|
|
return this.customer;
|
|
}
|
|
}
|