toMap method Null safety

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() => {
      "uuid": uuid,
      "product_id": productId,
      "product_name": productName,
      "unit_price": unitPrice,
      "sub_total": subTotal,
      "unique_check": uniqueCheck,
      "quantity": quantity == 0 ? null : quantity,
      "item_cart_index": itemCartIndex,
      "product_details":
          productDetails == null ? null : productDetails.toJson(),
    };