copyWith method

  1. @override
FastItem<T> copyWith({
  1. FastListItemDescriptor? descriptor,
  2. List<FastCategory>? categories,
  3. String? normalizedLabelText,
  4. String? descriptionText,
  5. String? labelText,
  6. bool? isEnabled,
  7. 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,
  );
}