copyWith method

Span copyWith({
  1. SpanExtent? extent,
  2. SpanPadding? padding,
  3. Map<Type, GestureRecognizerFactory<GestureRecognizer>>? recognizerFactories,
  4. PointerEnterEventListener? onEnter,
  5. PointerExitEventListener? onExit,
  6. MouseCursor? cursor,
  7. SpanDecoration? backgroundDecoration,
  8. SpanDecoration? foregroundDecoration,
})

Create a clone of the current Span but with provided parameters overridden.

Implementation

Span copyWith({
  SpanExtent? extent,
  SpanPadding? padding,
  Map<Type, GestureRecognizerFactory>? recognizerFactories,
  PointerEnterEventListener? onEnter,
  PointerExitEventListener? onExit,
  MouseCursor? cursor,
  SpanDecoration? backgroundDecoration,
  SpanDecoration? foregroundDecoration,
}) {
  return Span(
    extent: extent ?? this.extent,
    padding: padding ?? this.padding,
    recognizerFactories: recognizerFactories ?? this.recognizerFactories,
    onEnter: onEnter ?? this.onEnter,
    onExit: onExit ?? this.onExit,
    cursor: cursor ?? this.cursor,
    backgroundDecoration: backgroundDecoration ?? this.backgroundDecoration,
    foregroundDecoration: foregroundDecoration ?? this.foregroundDecoration,
  );
}