copyWith method

  1. @override
Hero copyWith({
  1. String? id,
  2. String? classes,
  3. Styles? css,
  4. Map<String, String>? attributes,
  5. Map<String, List<UiEventHandler>>? eventHandlers,
  6. Key? key,
})
override

An abstract method that concrete components must implement to create a copy of themselves with new values.

Implementation

@override
Hero copyWith({
  String? id,
  String? classes,
  Styles? css,
  Map<String, String>? attributes,
  Map<String, List<UiEventHandler>>? eventHandlers,
  Key? key,
}) {
  return Hero(
    children,
    tag: tag,
    style: style as List<HeroStyling>?,
    id: id ?? this.id,
    classes: mergeClasses(this.classes, classes),
    css: css ?? this.css,
    attributes: attributes ?? userProvidedAttributes,
    eventHandlers: eventHandlers ?? this.eventHandlers,
    key: key ?? this.key,
  );
}