copyWith method Null safety

TabBarTheme copyWith(
  1. {Decoration? indicator,
  2. TabBarIndicatorSize? indicatorSize,
  3. Color? labelColor,
  4. EdgeInsetsGeometry? labelPadding,
  5. TextStyle? labelStyle,
  6. Color? unselectedLabelColor,
  7. TextStyle? unselectedLabelStyle,
  8. MaterialStateProperty<Color?>? overlayColor,
  9. InteractiveInkFeatureFactory? splashFactory,
  10. MaterialStateProperty<MouseCursor?>? mouseCursor}
)

Creates a copy of this object but with the given fields replaced with the new values.

Implementation

TabBarTheme copyWith({
  Decoration? indicator,
  TabBarIndicatorSize? indicatorSize,
  Color? labelColor,
  EdgeInsetsGeometry? labelPadding,
  TextStyle? labelStyle,
  Color? unselectedLabelColor,
  TextStyle? unselectedLabelStyle,
  MaterialStateProperty<Color?>? overlayColor,
  InteractiveInkFeatureFactory? splashFactory,
  MaterialStateProperty<MouseCursor?>? mouseCursor,
}) {
  return TabBarTheme(
    indicator: indicator ?? this.indicator,
    indicatorSize: indicatorSize ?? this.indicatorSize,
    labelColor: labelColor ?? this.labelColor,
    labelPadding: labelPadding ?? this.labelPadding,
    labelStyle: labelStyle ?? this.labelStyle,
    unselectedLabelColor: unselectedLabelColor ?? this.unselectedLabelColor,
    unselectedLabelStyle: unselectedLabelStyle ?? this.unselectedLabelStyle,
    overlayColor: overlayColor ?? this.overlayColor,
    splashFactory: splashFactory ?? this.splashFactory,
    mouseCursor: mouseCursor ?? this.mouseCursor,
  );
}