copyWith method Null safety

TimePickerThemeData copyWith(
  1. {Color? backgroundColor,
  2. Color? hourMinuteTextColor,
  3. Color? hourMinuteColor,
  4. Color? dayPeriodTextColor,
  5. Color? dayPeriodColor,
  6. Color? dialHandColor,
  7. Color? dialBackgroundColor,
  8. Color? dialTextColor,
  9. Color? entryModeIconColor,
  10. TextStyle? hourMinuteTextStyle,
  11. TextStyle? dayPeriodTextStyle,
  12. TextStyle? helpTextStyle,
  13. ShapeBorder? shape,
  14. ShapeBorder? hourMinuteShape,
  15. OutlinedBorder? dayPeriodShape,
  16. BorderSide? dayPeriodBorderSide,
  17. InputDecorationTheme? inputDecorationTheme}
)

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

Implementation

TimePickerThemeData copyWith({
  Color? backgroundColor,
  Color? hourMinuteTextColor,
  Color? hourMinuteColor,
  Color? dayPeriodTextColor,
  Color? dayPeriodColor,
  Color? dialHandColor,
  Color? dialBackgroundColor,
  Color? dialTextColor,
  Color? entryModeIconColor,
  TextStyle? hourMinuteTextStyle,
  TextStyle? dayPeriodTextStyle,
  TextStyle? helpTextStyle,
  ShapeBorder? shape,
  ShapeBorder? hourMinuteShape,
  OutlinedBorder? dayPeriodShape,
  BorderSide? dayPeriodBorderSide,
  InputDecorationTheme? inputDecorationTheme,
}) {
  return TimePickerThemeData(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    hourMinuteTextColor: hourMinuteTextColor ?? this.hourMinuteTextColor,
    hourMinuteColor: hourMinuteColor ?? this.hourMinuteColor,
    dayPeriodTextColor: dayPeriodTextColor ?? this.dayPeriodTextColor,
    dayPeriodColor: dayPeriodColor ?? this.dayPeriodColor,
    dialHandColor: dialHandColor ?? this.dialHandColor,
    dialBackgroundColor: dialBackgroundColor ?? this.dialBackgroundColor,
    dialTextColor: dialTextColor ?? this.dialTextColor,
    entryModeIconColor: entryModeIconColor ?? this.entryModeIconColor,
    hourMinuteTextStyle: hourMinuteTextStyle ?? this.hourMinuteTextStyle,
    dayPeriodTextStyle: dayPeriodTextStyle ?? this.dayPeriodTextStyle,
    helpTextStyle: helpTextStyle ?? this.helpTextStyle,
    shape: shape ?? this.shape,
    hourMinuteShape: hourMinuteShape ?? this.hourMinuteShape,
    dayPeriodShape: dayPeriodShape ?? this.dayPeriodShape,
    dayPeriodBorderSide: dayPeriodBorderSide ?? this.dayPeriodBorderSide,
    inputDecorationTheme: inputDecorationTheme ?? this.inputDecorationTheme,
  );
}