copyWith method

ThemeData copyWith({
  1. Color? primaryColor,
  2. Color? backgroundColor,
  3. Color? textColor,
  4. Color? selectedColor,
  5. Color? borderColor,
  6. Color? dividerColor,
})

Creates a copy of this theme with the given fields replaced.

Implementation

ThemeData copyWith({
  Color? primaryColor,
  Color? backgroundColor,
  Color? textColor,
  Color? selectedColor,
  Color? borderColor,
  Color? dividerColor,
}) {
  return ThemeData(
    primaryColor: primaryColor ?? this.primaryColor,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    textColor: textColor ?? this.textColor,
    selectedColor: selectedColor ?? this.selectedColor,
    borderColor: borderColor ?? this.borderColor,
    dividerColor: dividerColor ?? this.dividerColor,
  );
}