toJson method

Map<String, dynamic> toJson()

Converts the customer details to a JSON representation.

Implementation

Map<String, dynamic> toJson() => {
      'firstName': firstName,
      'lastName': lastName,
      'email': email,
      'phone': phone,
      'billingAddress': billingAddress?.toJson(),
      'shippingAddress': shippingAddress?.toJson(),
    }..removeWhere((key, value) => value == null);