copyWith method
SwayzeHeaderState
copyWith({
- int? count,
- int? elasticCount,
- Iterable<
SwayzeHeaderData> ? headerData, - int? frozenCount,
Copies the state overriding specific fields.
If headerData
is not provided, reuse the current
map of customSizedHeaders.
Implementation
SwayzeHeaderState copyWith({
int? count,
int? elasticCount,
Iterable<SwayzeHeaderData>? headerData,
int? frozenCount,
}) {
if (headerData != null) {
return SwayzeHeaderState(
elasticCount: elasticCount ?? this.elasticCount,
defaultHeaderExtent: defaultHeaderExtent,
count: count ?? this.count,
headerData: headerData,
frozenCount: frozenCount ?? this.frozenCount,
);
}
return SwayzeHeaderState._fromSortedHeaderData(
elasticCount: elasticCount ?? this.elasticCount,
defaultHeaderExtent: defaultHeaderExtent,
count: count ?? this.count,
sortedHeaderData: _customSizedHeaders,
frozenCount: frozenCount ?? this.frozenCount,
);
}