copyWith method

  1. @override
ThemeExtension<CustomTheme> copyWith({
  1. CustomFontStyle? fontStyle,
  2. CustomColors? colors,
})
override

Creates a copy of this theme extension with the given fields replaced by the non-null parameter values.

Implementation

@override
ThemeExtension<CustomTheme> copyWith({
  CustomFontStyle? fontStyle,
  CustomColors? colors,
}) {
  return CustomTheme(
    colors: colors ?? this.colors,
    fontStyle: fontStyle ?? this.fontStyle,
  );
}