copyWith method
FastItem<T>
copyWith({
- FastListItemDescriptor? descriptor,
- List<
FastCategory> ? categories, - String? normalizedLabelText,
- String? descriptionText,
- String? labelText,
- bool? isEnabled,
- T? value,
override
Creates a copy of this TModel but with the given fields replaced with the new values.
For example:
var myModel2 = myModel1.copyWith(age: 42);
Implementation
@override
// ignore: code-metrics
FastItem<T> copyWith({
FastListItemDescriptor? descriptor,
List<FastCategory>? categories,
String? normalizedLabelText,
String? descriptionText,
String? labelText,
bool? isEnabled,
T? value,
}) {
return FastItem<T>(
normalizedLabelText: normalizedLabelText ?? this.normalizedLabelText,
descriptionText: descriptionText ?? this.descriptionText,
categories: categories ?? this.categories,
descriptor: descriptor ?? this.descriptor,
isEnabled: isEnabled ?? this.isEnabled,
labelText: labelText ?? this.labelText,
value: value ?? this.value,
);
}