copyWith method

AnnotationTheme copyWith({
  1. Color? selectionBorderColor,
  2. Color? selectionBackgroundColor,
  3. Color? highlightBorderColor,
  4. Color? highlightBackgroundColor,
  5. double? borderWidth,
  6. double? highlightBorderWidthDelta,
  7. BorderRadius? borderRadius,
})

Creates a copy of this theme with the specified properties replaced.

All parameters are optional. If a parameter is not provided, the corresponding property from the current theme is used.

Example:

final baseTheme = AnnotationTheme.light;
final customTheme = baseTheme.copyWith(
  selectionBorderColor: Colors.purple,
  borderWidth: 3.0,
);

Implementation

AnnotationTheme copyWith({
  Color? selectionBorderColor,
  Color? selectionBackgroundColor,
  Color? highlightBorderColor,
  Color? highlightBackgroundColor,
  double? borderWidth,
  double? highlightBorderWidthDelta,
  BorderRadius? borderRadius,
}) {
  return AnnotationTheme(
    selectionBorderColor: selectionBorderColor ?? this.selectionBorderColor,
    selectionBackgroundColor:
        selectionBackgroundColor ?? this.selectionBackgroundColor,
    highlightBorderColor: highlightBorderColor ?? this.highlightBorderColor,
    highlightBackgroundColor:
        highlightBackgroundColor ?? this.highlightBackgroundColor,
    borderWidth: borderWidth ?? this.borderWidth,
    highlightBorderWidthDelta:
        highlightBorderWidthDelta ?? this.highlightBorderWidthDelta,
    borderRadius: borderRadius ?? this.borderRadius,
  );
}