copyWith method

ThemeSettings copyWith({
  1. BuiltInTheme? baseTheme,
  2. int? accentColor,
  3. Background? background()?,
  4. BackgroundFill? outgoingMessageFill()?,
  5. bool? animateOutgoingMessageFill,
  6. bool? hasOutgoingMessageAccentColor,
  7. int? outgoingMessageAccentColor,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

ThemeSettings copyWith({
  BuiltInTheme? baseTheme,
  int? accentColor,
  Background? Function()? background,
  BackgroundFill? Function()? outgoingMessageFill,
  bool? animateOutgoingMessageFill,
  bool? hasOutgoingMessageAccentColor,
  int? outgoingMessageAccentColor,
}) => ThemeSettings(
  baseTheme: baseTheme ?? this.baseTheme,
  accentColor: accentColor ?? this.accentColor,
  background: background != null ? background() : this.background,
  outgoingMessageFill: outgoingMessageFill != null
      ? outgoingMessageFill()
      : this.outgoingMessageFill,
  animateOutgoingMessageFill:
      animateOutgoingMessageFill ?? this.animateOutgoingMessageFill,
  hasOutgoingMessageAccentColor:
      hasOutgoingMessageAccentColor ?? this.hasOutgoingMessageAccentColor,
  outgoingMessageAccentColor:
      outgoingMessageAccentColor ?? this.outgoingMessageAccentColor,
);