copyWith method

Datum copyWith({
  1. String? id,
  2. int? level,
  3. String? name,
  4. String? description,
  5. double? price,
  6. double? originalPackagePrice,
  7. double? renewalPrice,
  8. int? renewalPricePercent,
  9. bool? allowFlightBooking,
  10. bool? available,
  11. int? durationDays,
  12. int? trialDays,
  13. String? currency,
  14. List<String>? type,
  15. int? adultPassengerLimit,
  16. int? maxExclusiveBookings,
  17. int? memberDiscountPercentage,
  18. int? rateRequest,
  19. int? neoMilesPaymentPercentage,
  20. int? neoOneMonthlySubscription,
  21. int? searchCredit,
  22. int? searchCreditUsd,
  23. int? neoMilesBonus,
  24. int? discountedPrice,
  25. int? bookingBonus,
  26. int? resortRequest,
  27. double? totalPrice,
  28. double? priceInBTC,
  29. bool? isUpgrade,
  30. bool? isAddon,
  31. List<Addon>? availableAddons,
})

Implementation

Datum copyWith({
String? id,
int? level,
String? name,
String? description,
double? price,
double? originalPackagePrice,
double? renewalPrice,
int? renewalPricePercent,
bool? allowFlightBooking,
bool? available,
int? durationDays,
int? trialDays,
String? currency,
List<String>? type,
int? adultPassengerLimit,
int? maxExclusiveBookings,
int? memberDiscountPercentage,
int? rateRequest,
int? neoMilesPaymentPercentage,
int? neoOneMonthlySubscription,
int? searchCredit,
int? searchCreditUsd,
int? neoMilesBonus,
int? discountedPrice,
int? bookingBonus,
int? resortRequest,
double? totalPrice,
double? priceInBTC,
bool? isUpgrade,
bool? isAddon,
List<Addon>? availableAddons,
}) {
return Datum(
  id: id ?? this.id,
  level: level ?? this.level,
  name: name ?? this.name,
  description: description ?? this.description,
  price: price ?? this.price,
  originalPackagePrice: originalPackagePrice ?? this.originalPackagePrice,
  renewalPrice: renewalPrice ?? this.renewalPrice,
  renewalPricePercent: renewalPricePercent ?? this.renewalPricePercent,
  allowFlightBooking: allowFlightBooking ?? this.allowFlightBooking,
  available: available ?? this.available,
  durationDays: durationDays ?? this.durationDays,
  trialDays: trialDays ?? this.trialDays,
  currency: currency ?? this.currency,
  type: type ?? this.type?.toList(), // Create a copy of the list
  adultPassengerLimit: adultPassengerLimit ?? this.adultPassengerLimit,
  maxExclusiveBookings: maxExclusiveBookings ?? this.maxExclusiveBookings,
  memberDiscountPercentage: memberDiscountPercentage ?? this.memberDiscountPercentage,
  rateRequest: rateRequest ?? this.rateRequest,
  neoMilesPaymentPercentage: neoMilesPaymentPercentage ?? this.neoMilesPaymentPercentage,
  neoOneMonthlySubscription: neoOneMonthlySubscription ?? this.neoOneMonthlySubscription,
  searchCredit: searchCredit ?? this.searchCredit,
  searchCreditUsd: searchCreditUsd ?? this.searchCreditUsd,
  neoMilesBonus: neoMilesBonus ?? this.neoMilesBonus,
  discountedPrice: discountedPrice ?? this.discountedPrice,
  bookingBonus: bookingBonus ?? this.bookingBonus,
  resortRequest: resortRequest ?? this.resortRequest,
  totalPrice: totalPrice ?? this.totalPrice,
  priceInBTC: priceInBTC ?? this.priceInBTC,
  isUpgrade: isUpgrade ?? this.isUpgrade,
  isAddon: isAddon ?? this.isAddon,
  availableAddons: availableAddons ?? this.availableAddons,
);
}