Customer.fromJson constructor

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

Implementation

Customer.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  dateCreated = json['date_created'];
  dateCreatedGmt = json['date_created_gmt'];
  dateModified = json['date_modified'];
  dateModifiedGmt = json['date_modified_gmt'];
  email = json['email'];
  firstName = json['first_name'];
  lastName = json['last_name'];
  role = json['role'];
  username = json['username'];
  billing =
      json['billing'] != null ? Billing.fromJson(json['billing']) : null;
  shipping =
      json['shipping'] != null ? Shipping.fromJson(json['shipping']) : null;
  isPayingCustomer = json['is_paying_customer'];
  avatarUrl = json['avatar_url'];
  metaData =
      (json['meta_data'] as List).map((i) => MetaData.fromJson(i)).toList();
  links = json['_links'] != null ? Links.fromJson(json['_links']) : null;
}