copyWith method
OpeningHours
copyWith({
- List<
Period> ? periods, - List<
String> ? weekdayDescriptions, - SecondaryHoursType? secondaryHoursType,
- List<
SpecialDay> ? specialDays, - DateTime? nextOpenTime,
- DateTime? nextCloseTime,
- bool? openNow,
Implementation
OpeningHours copyWith({
List<Period>? periods,
List<String>? weekdayDescriptions,
SecondaryHoursType? secondaryHoursType,
List<SpecialDay>? specialDays,
DateTime? nextOpenTime,
DateTime? nextCloseTime,
bool? openNow,
}) {
return OpeningHours(
periods:
((periods?.isNotEmpty ?? false) ? periods : null) ?? this.periods,
weekdayDescriptions:
((weekdayDescriptions?.isNotEmpty ?? false)
? weekdayDescriptions
: null) ??
this.weekdayDescriptions,
secondaryHoursType: secondaryHoursType ?? this.secondaryHoursType,
specialDays:
((specialDays?.isNotEmpty ?? false) ? specialDays : null) ??
this.specialDays,
nextOpenTime: nextOpenTime ?? this.nextOpenTime,
nextCloseTime: nextCloseTime ?? this.nextCloseTime,
openNow: openNow ?? this.openNow,
);
}