Customer.fromJson constructor

Customer.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Customer.fromJson(Map<String, dynamic> json) {
  return Customer(
    id: json['id'] is String ? int.tryParse(json['id']) : json['id'],
    firstName: json['first_name']?.toString(),
    lastName: json['last_name']?.toString(),
    email: json['email']?.toString(),
    customerCode: json['customer_code']?.toString(),
    phone: json['phone']?.toString(),
  );
}