copyWith method
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,
})
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,
);
}