class Customer { String name; String email; String firstName; String sex; int age; String active; int customerId; Customer({this.customerId, this.name, this.firstName, this.email, this.sex, this.age, this.active}); Customer.fromJson(Map json) { this.customerId = json['customer_id']; this.name = json['name']; this.firstName = json['firstname']; this.email = json['email']; this.sex = json['sex']; this.age = json['age']; this.active = json['active']; } Map toJson() => { "name": name, "firstName": firstName, "email": email, "age": age, "sex": sex, "active": 'Y' }; }