CustomerModel.fromJson constructor

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

Implementation

factory CustomerModel.fromJson(Map<String, dynamic> json) {
  return CustomerModel(
    id: json['id'],
    dateCreated: DateTime.parse(json['date_created']),
    dateCreatedGmt: DateTime.parse(json['date_created_gmt']),
    dateModified: DateTime.parse(json['date_modified']),
    dateModifiedGmt: DateTime.parse(json['date_modified_gmt']),
    email: json['email'],
    firstName: json['first_name'],
    lastName: json['last_name'],
    role: json['role'],
    username: json['username'],
    password: json['password'],
    billing: json['billing'],
    shipping: json['shipping'],
    isPayingCustomer: json['is_paying_customer'],
    avatarUrl: json['avatar_url'],
    metaData: json['meta_data'],
  );
}