copyWith method Null safety

ScrollbarThemeData copyWith(
  1. {MaterialStateProperty<bool?>? thumbVisibility,
  2. MaterialStateProperty<double?>? thickness,
  3. MaterialStateProperty<bool?>? trackVisibility,
  4. bool? showTrackOnHover,
  5. bool? interactive,
  6. Radius? radius,
  7. MaterialStateProperty<Color?>? thumbColor,
  8. MaterialStateProperty<Color?>? trackColor,
  9. MaterialStateProperty<Color?>? trackBorderColor,
  10. double? crossAxisMargin,
  11. double? mainAxisMargin,
  12. double? minThumbLength,
  13. @Deprecated('Use thumbVisibility instead. ' 'This feature was deprecated after v2.9.0-1.0.pre.') bool? isAlwaysShown}
)

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

Implementation

ScrollbarThemeData copyWith({
  MaterialStateProperty<bool?>? thumbVisibility,
  MaterialStateProperty<double?>? thickness,
  MaterialStateProperty<bool?>? trackVisibility,
  bool? showTrackOnHover,
  bool? interactive,
  Radius? radius,
  MaterialStateProperty<Color?>? thumbColor,
  MaterialStateProperty<Color?>? trackColor,
  MaterialStateProperty<Color?>? trackBorderColor,
  double? crossAxisMargin,
  double? mainAxisMargin,
  double? minThumbLength,
  @Deprecated(
    'Use thumbVisibility instead. '
    'This feature was deprecated after v2.9.0-1.0.pre.',
  )
  bool? isAlwaysShown,
}) {
  return ScrollbarThemeData(
    thumbVisibility: thumbVisibility ?? this.thumbVisibility,
    thickness: thickness ?? this.thickness,
    trackVisibility: trackVisibility ?? this.trackVisibility,
    showTrackOnHover: showTrackOnHover ?? this.showTrackOnHover,
    isAlwaysShown: isAlwaysShown ?? this.isAlwaysShown,
    interactive: interactive ?? this.interactive,
    radius: radius ?? this.radius,
    thumbColor: thumbColor ?? this.thumbColor,
    trackColor: trackColor ?? this.trackColor,
    trackBorderColor: trackBorderColor ?? this.trackBorderColor,
    crossAxisMargin: crossAxisMargin ?? this.crossAxisMargin,
    mainAxisMargin: mainAxisMargin ?? this.mainAxisMargin,
    minThumbLength: minThumbLength ?? this.minThumbLength,
  );
}