copyWith method

DatePickerThemeData copyWith({
  1. Color? backgroundColor,
  2. double? elevation,
  3. Color? shadowColor,
  4. Color? surfaceTintColor,
  5. ShapeBorder? shape,
  6. Color? headerBackgroundColor,
  7. Color? headerForegroundColor,
  8. TextStyle? headerHeadlineStyle,
  9. TextStyle? headerHelpStyle,
  10. TextStyle? weekdayStyle,
  11. TextStyle? dayStyle,
  12. MaterialStateProperty<Color?>? dayForegroundColor,
  13. MaterialStateProperty<Color?>? dayBackgroundColor,
  14. MaterialStateProperty<Color?>? dayOverlayColor,
  15. MaterialStateProperty<OutlinedBorder?>? dayShape,
  16. MaterialStateProperty<Color?>? todayForegroundColor,
  17. MaterialStateProperty<Color?>? todayBackgroundColor,
  18. BorderSide? todayBorder,
  19. TextStyle? yearStyle,
  20. MaterialStateProperty<Color?>? yearForegroundColor,
  21. MaterialStateProperty<Color?>? yearBackgroundColor,
  22. MaterialStateProperty<Color?>? yearOverlayColor,
  23. Color? rangePickerBackgroundColor,
  24. double? rangePickerElevation,
  25. Color? rangePickerShadowColor,
  26. Color? rangePickerSurfaceTintColor,
  27. ShapeBorder? rangePickerShape,
  28. Color? rangePickerHeaderBackgroundColor,
  29. Color? rangePickerHeaderForegroundColor,
  30. TextStyle? rangePickerHeaderHeadlineStyle,
  31. TextStyle? rangePickerHeaderHelpStyle,
  32. Color? rangeSelectionBackgroundColor,
  33. MaterialStateProperty<Color?>? rangeSelectionOverlayColor,
  34. Color? dividerColor,
  35. InputDecorationTheme? inputDecorationTheme,
  36. ButtonStyle? cancelButtonStyle,
  37. ButtonStyle? confirmButtonStyle,
  38. Locale? locale,
})

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

Implementation

DatePickerThemeData copyWith({
  Color? backgroundColor,
  double? elevation,
  Color? shadowColor,
  Color? surfaceTintColor,
  ShapeBorder? shape,
  Color? headerBackgroundColor,
  Color? headerForegroundColor,
  TextStyle? headerHeadlineStyle,
  TextStyle? headerHelpStyle,
  TextStyle? weekdayStyle,
  TextStyle? dayStyle,
  MaterialStateProperty<Color?>? dayForegroundColor,
  MaterialStateProperty<Color?>? dayBackgroundColor,
  MaterialStateProperty<Color?>? dayOverlayColor,
  MaterialStateProperty<OutlinedBorder?>? dayShape,
  MaterialStateProperty<Color?>? todayForegroundColor,
  MaterialStateProperty<Color?>? todayBackgroundColor,
  BorderSide? todayBorder,
  TextStyle? yearStyle,
  MaterialStateProperty<Color?>? yearForegroundColor,
  MaterialStateProperty<Color?>? yearBackgroundColor,
  MaterialStateProperty<Color?>? yearOverlayColor,
  Color? rangePickerBackgroundColor,
  double? rangePickerElevation,
  Color? rangePickerShadowColor,
  Color? rangePickerSurfaceTintColor,
  ShapeBorder? rangePickerShape,
  Color? rangePickerHeaderBackgroundColor,
  Color? rangePickerHeaderForegroundColor,
  TextStyle? rangePickerHeaderHeadlineStyle,
  TextStyle? rangePickerHeaderHelpStyle,
  Color? rangeSelectionBackgroundColor,
  MaterialStateProperty<Color?>? rangeSelectionOverlayColor,
  Color? dividerColor,
  InputDecorationTheme? inputDecorationTheme,
  ButtonStyle? cancelButtonStyle,
  ButtonStyle? confirmButtonStyle,
  Locale? locale,
}) {
  return DatePickerThemeData(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    elevation: elevation ?? this.elevation,
    shadowColor: shadowColor ?? this.shadowColor,
    surfaceTintColor: surfaceTintColor ?? this.surfaceTintColor,
    shape: shape ?? this.shape,
    headerBackgroundColor: headerBackgroundColor ?? this.headerBackgroundColor,
    headerForegroundColor: headerForegroundColor ?? this.headerForegroundColor,
    headerHeadlineStyle: headerHeadlineStyle ?? this.headerHeadlineStyle,
    headerHelpStyle: headerHelpStyle ?? this.headerHelpStyle,
    weekdayStyle: weekdayStyle ?? this.weekdayStyle,
    dayStyle: dayStyle ?? this.dayStyle,
    dayForegroundColor: dayForegroundColor ?? this.dayForegroundColor,
    dayBackgroundColor: dayBackgroundColor ?? this.dayBackgroundColor,
    dayOverlayColor: dayOverlayColor ?? this.dayOverlayColor,
    dayShape: dayShape ?? this.dayShape,
    todayForegroundColor: todayForegroundColor ?? this.todayForegroundColor,
    todayBackgroundColor: todayBackgroundColor ?? this.todayBackgroundColor,
    todayBorder: todayBorder ?? this.todayBorder,
    yearStyle: yearStyle ?? this.yearStyle,
    yearForegroundColor: yearForegroundColor ?? this.yearForegroundColor,
    yearBackgroundColor: yearBackgroundColor ?? this.yearBackgroundColor,
    yearOverlayColor: yearOverlayColor ?? this.yearOverlayColor,
    rangePickerBackgroundColor: rangePickerBackgroundColor ?? this.rangePickerBackgroundColor,
    rangePickerElevation: rangePickerElevation ?? this.rangePickerElevation,
    rangePickerShadowColor: rangePickerShadowColor ?? this.rangePickerShadowColor,
    rangePickerSurfaceTintColor: rangePickerSurfaceTintColor ?? this.rangePickerSurfaceTintColor,
    rangePickerShape: rangePickerShape ?? this.rangePickerShape,
    rangePickerHeaderBackgroundColor: rangePickerHeaderBackgroundColor ?? this.rangePickerHeaderBackgroundColor,
    rangePickerHeaderForegroundColor: rangePickerHeaderForegroundColor ?? this.rangePickerHeaderForegroundColor,
    rangePickerHeaderHeadlineStyle: rangePickerHeaderHeadlineStyle ?? this.rangePickerHeaderHeadlineStyle,
    rangePickerHeaderHelpStyle: rangePickerHeaderHelpStyle ?? this.rangePickerHeaderHelpStyle,
    rangeSelectionBackgroundColor: rangeSelectionBackgroundColor ?? this.rangeSelectionBackgroundColor,
    rangeSelectionOverlayColor: rangeSelectionOverlayColor ?? this.rangeSelectionOverlayColor,
    dividerColor: dividerColor ?? this.dividerColor,
    inputDecorationTheme: inputDecorationTheme ?? this.inputDecorationTheme,
    cancelButtonStyle: cancelButtonStyle ?? this.cancelButtonStyle,
    confirmButtonStyle: confirmButtonStyle ?? this.confirmButtonStyle,
    locale: locale ?? this.locale,
  );
}