copyWith method Null safety

DataTableThemeData copyWith(
  1. {Decoration? decoration,
  2. MaterialStateProperty<Color?>? dataRowColor,
  3. double? dataRowHeight,
  4. TextStyle? dataTextStyle,
  5. MaterialStateProperty<Color?>? headingRowColor,
  6. double? headingRowHeight,
  7. TextStyle? headingTextStyle,
  8. double? horizontalMargin,
  9. double? columnSpacing,
  10. double? dividerThickness,
  11. double? checkboxHorizontalMargin}
)

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

Implementation

DataTableThemeData copyWith({
  Decoration? decoration,
  MaterialStateProperty<Color?>? dataRowColor,
  double? dataRowHeight,
  TextStyle? dataTextStyle,
  MaterialStateProperty<Color?>? headingRowColor,
  double? headingRowHeight,
  TextStyle? headingTextStyle,
  double? horizontalMargin,
  double? columnSpacing,
  double? dividerThickness,
  double? checkboxHorizontalMargin,
}) {
  return DataTableThemeData(
    decoration: decoration ?? this.decoration,
    dataRowColor: dataRowColor ?? this.dataRowColor,
    dataRowHeight: dataRowHeight ?? this.dataRowHeight,
    dataTextStyle: dataTextStyle ?? this.dataTextStyle,
    headingRowColor: headingRowColor ?? this.headingRowColor,
    headingRowHeight: headingRowHeight ?? this.headingRowHeight,
    headingTextStyle: headingTextStyle ?? this.headingTextStyle,
    horizontalMargin: horizontalMargin ?? this.horizontalMargin,
    columnSpacing: columnSpacing ?? this.columnSpacing,
    dividerThickness: dividerThickness ?? this.dividerThickness,
    checkboxHorizontalMargin: checkboxHorizontalMargin ?? this.checkboxHorizontalMargin,
  );
}